mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 05:01:19 -03:30
Fix a bug where we would treat the new model value like the old one when comparing activity stream changes
This commit is contained in:
parent
44d9d12e4d
commit
3d228b2955
@ -746,7 +746,7 @@ class PermissionSerializer(BaseSerializer):
|
||||
model = Permission
|
||||
fields = BASE_FIELDS + ('user', 'team', 'project', 'inventory',
|
||||
'permission_type',)
|
||||
|
||||
|
||||
def get_related(self, obj):
|
||||
if obj is None:
|
||||
return {}
|
||||
|
||||
@ -264,6 +264,7 @@ def model_instance_diff(old, new, serializer_mapping=None):
|
||||
if old_value != new_value and field not in Credential.PASSWORD_FIELDS:
|
||||
if type(old_value) not in (bool, int, type(None)):
|
||||
old_value = str(old_value)
|
||||
if type(new_value) not in (bool, int, type(None)):
|
||||
new_value = str(new_value)
|
||||
diff[field] = (old_value, new_value)
|
||||
elif old_value != new_value and field in Credential.PASSWORD_FIELDS:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user