From 634dea1bb1b100227322d281d693bfdaa94aa091 Mon Sep 17 00:00:00 2001 From: jerolomb Date: Fri, 23 Aug 2024 14:07:19 +0200 Subject: [PATCH] comment #163 prevent error when a user is linked to several sector in one company quickfix --- governanceplatform/helpers.py | 2 +- theme | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/governanceplatform/helpers.py b/governanceplatform/helpers.py index 52887fa..7c180e5 100644 --- a/governanceplatform/helpers.py +++ b/governanceplatform/helpers.py @@ -48,7 +48,7 @@ def is_observer_user_viewving_all_incident(user: User) -> bool: def get_active_company_from_session(request) -> Optional[Company]: company_in_use = request.session.get("company_in_use") - return request.user.companies.get(id=company_in_use) if company_in_use else None + return request.user.companies.filter(id=company_in_use).first() if company_in_use else None def can_access_incident(user: User, incident: Incident, company_id=-1) -> bool: diff --git a/theme b/theme index 0e3ee8d..2216434 160000 --- a/theme +++ b/theme @@ -1 +1 @@ -Subproject commit 0e3ee8d3f3a94a62ab1eb16cc852a9b400b19c9e +Subproject commit 2216434ba9381d547067d17824cf0bd813621475