remove defualt from stake holder model
This commit is contained in:
@@ -45,7 +45,6 @@ class POSDeviceViewSet(viewsets.ModelViewSet, POSDeviceMixin):
|
|||||||
# get device owner (organization)
|
# get device owner (organization)
|
||||||
organization = self.get_device_organization()
|
organization = self.get_device_organization()
|
||||||
"""
|
"""
|
||||||
try:
|
|
||||||
# convert headers to dictionary
|
# convert headers to dictionary
|
||||||
headers_data = {key: request.headers.get(key) for key in self.HEADERS}
|
headers_data = {key: request.headers.get(key) for key in self.HEADERS}
|
||||||
|
|
||||||
@@ -136,24 +135,6 @@ class POSDeviceViewSet(viewsets.ModelViewSet, POSDeviceMixin):
|
|||||||
"provider": organization.name,
|
"provider": organization.name,
|
||||||
"provider_tell": organization.phone,
|
"provider_tell": organization.phone,
|
||||||
}, status=status.HTTP_412_PRECONDITION_FAILED)
|
}, status=status.HTTP_412_PRECONDITION_FAILED)
|
||||||
except Exception as e:
|
|
||||||
error_message = str(e)
|
|
||||||
error_title = e.__class__.__name__
|
|
||||||
error_traceback = traceback.format_exc()
|
|
||||||
print(error_message)
|
|
||||||
print(error_title)
|
|
||||||
print(error_traceback)
|
|
||||||
print(headers_data)
|
|
||||||
|
|
||||||
return Response(
|
|
||||||
{
|
|
||||||
"result": "خطای سرور داخلی رخ داده است. لطفا بعدا تلاش کنید.", # noqa
|
|
||||||
"error_message": error_message,
|
|
||||||
"error_title": error_title,
|
|
||||||
"error_traceback": error_traceback,
|
|
||||||
},
|
|
||||||
status=status.HTTP_500_INTERNAL_SERVER_ERROR
|
|
||||||
)
|
|
||||||
|
|
||||||
@action(
|
@action(
|
||||||
methods=['post'],
|
methods=['post'],
|
||||||
|
|||||||
@@ -238,7 +238,6 @@ class DeviceAssignmentViewSet(viewsets.ModelViewSet, SoftDeleteMixin):
|
|||||||
assignment=assignment,
|
assignment=assignment,
|
||||||
device=assignment.device,
|
device=assignment.device,
|
||||||
organization=assignment.client.organization,
|
organization=assignment.client.organization,
|
||||||
default=True
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
||||||
|
|||||||
Reference in New Issue
Block a user