From bcc191e7e181475532a328d21463f3c0de98cf75 Mon Sep 17 00:00:00 2001 From: Jaimyn Mayer Date: Fri, 31 May 2024 00:47:47 +1000 Subject: [PATCH] made vikunja team sync only happen if user active --- memberportal/membermatters/constance_config.py | 2 +- memberportal/membermatters/oidc_provider_settings.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/memberportal/membermatters/constance_config.py b/memberportal/membermatters/constance_config.py index 7983e030..3957f58c 100644 --- a/memberportal/membermatters/constance_config.py +++ b/memberportal/membermatters/constance_config.py @@ -419,7 +419,7 @@ "MEMBERBUCKS_CURRENCY", ), ), - ("Vikunja Integration", ("VIKUNJA_TEAMS")), + ("Vikunja Integration", ("VIKUNJA_TEAMS",)), ( "Trello Integration", ( diff --git a/memberportal/membermatters/oidc_provider_settings.py b/memberportal/membermatters/oidc_provider_settings.py index 0ef5958c..5e625ce8 100644 --- a/memberportal/membermatters/oidc_provider_settings.py +++ b/memberportal/membermatters/oidc_provider_settings.py @@ -69,10 +69,14 @@ def scope_vikunja_teams(self): if config.VIKUNJA_TEAMS: try: teams = json.loads(config.VIKUNJA_TEAMS) - - return { - "vikunja_groups": teams, - } + if self.user.profile.state == "active": + return { + "vikunja_groups": teams, + } + else: + return { + "vikunja_groups": [], + } except json.JSONDecodeError: logger.error( "VIKUNJA_TEAMS is not a valid JSON object and the Vikunja teams claim wasn't added."