Skip to content

Commit

Permalink
Merge branch 'main' into gn_issue_12170_unable_to_set_advanced_contac…
Browse files Browse the repository at this point in the history
…t_roles_in_metadata_editor
  • Loading branch information
mwallschlaeger authored May 6, 2024
2 parents 191fe0c + a12ca9d commit 0061662
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion geonode/base/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,37 @@ def get_attribute(self, instance):
return False



class UserSerializer(BaseDynamicModelSerializer):
class Meta:
ref_name = "UserProfile"
model = get_user_model()
name = "user"
view_name = "users-list"
fields = ("pk", "username", "first_name", "last_name", "avatar", "perms", "is_superuser", "is_staff", "orcid_identifier")
fields = ("pk",
"username",
"first_name",
"last_name",
"avatar",
"perms",
"is_superuser",
"is_staff",
"email",
"organization",
"profile",
"position",
"voice",
"fax",
"delivery",
"city",
"area",
"zipcode",
"keywords",
"country",
"language",
"timezone",
"orcid_identifier"
)

@classmethod
def setup_eager_loading(cls, queryset):
Expand All @@ -442,6 +466,10 @@ def to_representation(self, instance):
return data

avatar = AvatarUrlField(240, read_only=True)
keywords = ComplexDynamicRelationField(
SimpleHierarchicalKeywordSerializer, embed=False, many=True
)



class ContactRoleField(DynamicComputedField):
Expand Down

0 comments on commit 0061662

Please sign in to comment.