From 310b5dde5920b2927936d9f47acd3ef4a21b7385 Mon Sep 17 00:00:00 2001 From: Phil Weir Date: Wed, 27 Dec 2023 23:22:48 +0000 Subject: [PATCH] user_is_resource_reviewer no longer throws attributeerror is user is None --- arches/app/models/tile.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arches/app/models/tile.py b/arches/app/models/tile.py index f76c9469aad..fae8d3cba90 100644 --- a/arches/app/models/tile.py +++ b/arches/app/models/tile.py @@ -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 @@ -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