fix user edit bug with address
This commit is contained in:
@@ -121,7 +121,7 @@ class UserSerializer(serializers.ModelSerializer):
|
||||
if self.instance.national_code != national_code:
|
||||
if self.Meta.model.objects.filter(national_code=national_code).exists():
|
||||
raise UserExistException()
|
||||
|
||||
|
||||
return attrs
|
||||
|
||||
def to_representation(self, instance):
|
||||
@@ -158,8 +158,8 @@ class UserSerializer(serializers.ModelSerializer):
|
||||
instance.nationality = validated_data.get('nationality')
|
||||
instance.ownership = validated_data.get('ownership')
|
||||
instance.address = validated_data.get('address')
|
||||
instance.address = validated_data.get('unit_name')
|
||||
instance.address = validated_data.get('unit_national_id')
|
||||
instance.unit_name = validated_data.get('unit_name')
|
||||
instance.unit_national_id = validated_data.get('unit_national_id')
|
||||
instance.photo = validated_data.get('photo')
|
||||
instance.province = validated_data.get('province', instance.province)
|
||||
instance.city = validated_data.get('city', instance.city)
|
||||
|
||||
@@ -19,3 +19,6 @@
|
||||
[2025-10-27 14:18:07,772] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\Rasaddam_Backend\request_formatter.py changed, reloading.
|
||||
[2025-10-27 14:18:11,698] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
|
||||
[2025-10-27 14:42:16,070] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authentication\mixins\region_filter.py changed, reloading.
|
||||
[2025-10-27 14:42:18,042] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
|
||||
[2025-10-27 14:46:25,256] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authentication\api\v1\serializers\serializer.py changed, reloading.
|
||||
[2025-10-27 14:46:27,085] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
|
||||
|
||||
Reference in New Issue
Block a user