add some new data to device login data, first part of broker to stake holders assignment
This commit is contained in:
14
apps/core/mixins/soft_delete_mixin.py
Normal file
14
apps/core/mixins/soft_delete_mixin.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from rest_framework import status
|
||||
from rest_framework.response import Response
|
||||
|
||||
|
||||
class SoftDeleteMixin:
|
||||
def destroy(self, request, *args, **kwargs):
|
||||
""" override destroy -> soft delete """
|
||||
|
||||
instance = self.get_object() # noqa
|
||||
instance.soft_delete()
|
||||
return Response(
|
||||
{"detail": "رکورد با موفقیت حذف شد (Soft Delete)."},
|
||||
status=status.HTTP_200_OK
|
||||
)
|
||||
Reference in New Issue
Block a user