From 3e26f5a16c80bfb029d66be0b12fdc5de010b12b Mon Sep 17 00:00:00 2001 From: "Esteban J. G. Gabancho" Date: Mon, 15 Apr 2024 14:25:27 -0400 Subject: [PATCH] members: only use common keys in user relationship * Limits the user fields send for indexing to avoid issues when extending the user profile or preferences. (closes invenio-app-rdm#2198) --- invenio_communities/members/records/api.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/invenio_communities/members/records/api.py b/invenio_communities/members/records/api.py index 5bf3ac28b..f03351f1b 100644 --- a/invenio_communities/members/records/api.py +++ b/invenio_communities/members/records/api.py @@ -69,12 +69,19 @@ class MemberMixin: attrs=[ "email", "username", - "profile", - "preferences", "active", "confirmed", "verified_at", ], + # Explicitly list common keys from fields that can be customizable + keys=[ + "profile.affiliations", + "profile.full_name", + "preferences.locale", + "preferences.timezone", + "preferences.visibility", + "preferences.email_visibility", + ], ), group=ModelRelation( GroupAggregate,