edit assignment
This commit is contained in:
@@ -56,8 +56,9 @@ class DeviceAssignmentSerializer(ModelSerializer):
|
||||
device = attrs['device']
|
||||
client = attrs['client']
|
||||
|
||||
if self.Meta.model.objects.filter(device=device, client=client).exists():
|
||||
raise pos_exceptions.DeviceAlreadyAssigned()
|
||||
if not self.instance:
|
||||
if self.Meta.model.objects.filter(device=device, client=client).exists():
|
||||
raise pos_exceptions.DeviceAlreadyAssigned()
|
||||
|
||||
return attrs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user