1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

exclude created/modified from RoleSerializer

This commit is contained in:
AlanCoding 2018-03-29 08:59:03 -04:00
parent 8c3b1c06d9
commit 19c3e26cf2
No known key found for this signature in database
GPG Key ID: FD2C3C012A72926B

View File

@ -2261,6 +2261,7 @@ class RoleSerializer(BaseSerializer):
class Meta:
model = Role
fields = ('*', '-created', '-modified')
read_only_fields = ('id', 'role_field', 'description', 'name')
def to_representation(self, obj):
@ -2276,8 +2277,6 @@ class RoleSerializer(BaseSerializer):
ret['summary_fields']['resource_type'] = get_type_for_model(content_model)
ret['summary_fields']['resource_type_display_name'] = content_model._meta.verbose_name.title()
ret.pop('created')
ret.pop('modified')
return ret
def get_related(self, obj):