Skip to content

Commit

Permalink
use user.is_authenticated for admin protection
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLechemia committed Oct 30, 2023
1 parent bed6d06 commit 4379734
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/geonature/core/admin/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

class MyHomeView(AdminIndexView):
def is_accessible(self):
if g.current_user is None:
if not g.current_user.is_authenticated:
raise Unauthorized # return False leads to Forbidden which is different
return True

Expand Down

0 comments on commit 4379734

Please sign in to comment.