fix device assignment for non organization clients
This commit is contained in:
@@ -204,7 +204,15 @@ class DeviceAssignmentViewSet(viewsets.ModelViewSet, SoftDeleteMixin):
|
||||
data['client'] = client_id
|
||||
|
||||
elif client_data and client_data.get('organization') is False:
|
||||
pass
|
||||
# create client
|
||||
client = CustomOperations().custom_create(
|
||||
request=request,
|
||||
view=POSClientViewSet(),
|
||||
data=request.data['client_data']
|
||||
)
|
||||
client_id = client['id']
|
||||
|
||||
data['client'] = client_id
|
||||
|
||||
# create assignment
|
||||
serializer = self.serializer_class(data=data)
|
||||
|
||||
Reference in New Issue
Block a user