Skip to content

Commit

Permalink
comment #163 prevent error when a user is linked to several sector in…
Browse files Browse the repository at this point in the history
… one company quickfix
  • Loading branch information
jerolomb committed Aug 23, 2024
1 parent 722eca9 commit 634dea1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion governanceplatform/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion theme

0 comments on commit 634dea1

Please sign in to comment.