Antes de actualizar

This commit is contained in:
fjrodriguez
2023-02-24 12:26:21 -06:00
parent 4b5b044de9
commit 4983cdc8fa
8 changed files with 108 additions and 21 deletions

View File

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