From 2b6f2d3bd6118834e0c7084c91b9d0e2fbefaf8b Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Tue, 12 Nov 2024 23:08:45 +0100 Subject: [PATCH] fix: for compatibility with sqlalchemy >= 2 * the problem is on test_members_services.py. if test_add_denied runs it creates a situation where the curator role with number 3 is converted to string. which is the reason that the needs can't find an intersection because the need in the identity has still an int 3. --- invenio_communities/generators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invenio_communities/generators.py b/invenio_communities/generators.py index bad819125..24aa15eb5 100644 --- a/invenio_communities/generators.py +++ b/invenio_communities/generators.py @@ -389,7 +389,7 @@ class CommunitySelfMember(Generator): def needs(self, member=None, **kwargs): """Enabling needs.""" if member is not None and member.user_id is not None: - return [UserNeed(member.user_id)] + return [UserNeed(int(member.user_id))] return [] def query_filter(self, identity=None, **kwargs):