Skip to content

Commit

Permalink
user_is_resource_reviewer no longer throws attributeerror is user is …
Browse files Browse the repository at this point in the history
…None
  • Loading branch information
philtweir committed Dec 27, 2023
1 parent b2163ae commit 310b5dd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arches/app/models/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ def save(self, *args, **kwargs):
try:
if user is None and request is not None:
user = request.user
user_is_reviewer = user_is_resource_reviewer(user)
if user is not None:
user_is_reviewer = user_is_resource_reviewer(user)
except AttributeError: # no user - probably importing data
user = None

Expand Down Expand Up @@ -514,7 +515,10 @@ def delete(self, *args, **kwargs):
tile.delete(*args, request=request, **kwargs)
try:
user = request.user
user_is_reviewer = user_is_resource_reviewer(user)
if user is not None:
user_is_reviewer = user_is_resource_reviewer(user)
else:
user_is_reviewer = True
except AttributeError: # no user
user = None
user_is_reviewer = True
Expand Down

0 comments on commit 310b5dd

Please sign in to comment.