fix - device pre register & exception handling with json response
This commit is contained in:
@@ -78,6 +78,10 @@ class DeviceViewSet(BaseViewSet, SoftDeleteMixin, viewsets.ModelViewSet, AdminFi
|
||||
organization = get_organization_by_user(request.user)
|
||||
request.data.update({'organization': organization.id})
|
||||
|
||||
# ser device preregister to true
|
||||
# if device create in web panel, set to true for recognize by pos device
|
||||
request.data.update({'pre_registered': True})
|
||||
|
||||
# create device
|
||||
serializer = self.serializer_class(data=request.data)
|
||||
if serializer.is_valid():
|
||||
|
||||
Reference in New Issue
Block a user