Skip to content

Commit

Permalink
Fixes authentication on get_object_or_error
Browse files Browse the repository at this point in the history
This commit makes authentication required to access objects with `get_object_or_error`.

Previously, authentication was checked only... if object was not found
  • Loading branch information
privat-eco committed Apr 3, 2024
1 parent 5fea915 commit e4aaadc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions taiga/base/api/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def get_object_or_error(queryset, user, *filter_args, **filter_kwargs):
(if the user is not logged in).
"""
if not user.is_authenticated:
raise NotAuthenticated
try:
return _get_object_or_404(queryset, *filter_args, **filter_kwargs)
except (Http404, TypeError, ValueError):
if not user.is_authenticated:
raise NotAuthenticated
raise Http404

0 comments on commit e4aaadc

Please sign in to comment.