Antes de actualizar
This commit is contained in:
@@ -47,7 +47,7 @@ class DeviceSerializer(serializers.ModelSerializer):
|
||||
# A device with the same macAddress already exists for the given sistema and client
|
||||
# Get the number of existing devices and add 1 to create a new suffix
|
||||
suffix = existing_devices.count() + 1
|
||||
mac_address += f'_{suffix}'
|
||||
mac_address += f'_{suffix}'
|
||||
|
||||
validated_data['macAddress']= mac_address
|
||||
return super().create(validated_data)
|
||||
|
||||
Reference in New Issue
Block a user