Skip to content

Commit

Permalink
fix error 500 when access to admin without be logged - fix #3171
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLechemia committed Aug 30, 2024
1 parent 3598ca2 commit ca71c2a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/geonature/core/admin/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class CruvedProtectedMixin:
def is_accessible(self):
if g.current_user is None:
raise Unauthorized # return False leads to Forbidden which is different
if not g.current_user.is_authenticated:
raise Unauthorized
return self._can_action("R")

def _can_action(self, action):
Expand Down

0 comments on commit ca71c2a

Please sign in to comment.