fix - device pre register & exception handling with json response

This commit is contained in:
2025-11-09 14:35:14 +03:30
parent 0c5142aff3
commit c0f289284f
7 changed files with 118 additions and 9 deletions

View File

@@ -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():