Simplify permission lookup method. Add refresh class method to make sure
stored permissions are in sync with proxy permission. Add __repr__ method.
This commit is contained in:
@@ -63,8 +63,7 @@ class RoleNewPermissionSerializer(serializers.Serializer):
|
||||
|
||||
try:
|
||||
for pk in validated_data['permission_pk_list'].split(','):
|
||||
get_dict = {'pk': pk}
|
||||
stored_permission = Permission.get(get_dict=get_dict)
|
||||
stored_permission = Permission.get(pk=pk)
|
||||
|
||||
validated_data['role'].permissions.add(stored_permission)
|
||||
except KeyError as exception:
|
||||
|
||||
Reference in New Issue
Block a user