diff --git a/librarian_server/api/checkin.py b/librarian_server/api/checkin.py index f2dc074..600daf9 100644 --- a/librarian_server/api/checkin.py +++ b/librarian_server/api/checkin.py @@ -77,11 +77,17 @@ def modify_transfers_by_id( reasons.add("No destination transfer with the appropriate ID was found.") continue - authorized = ( - user.is_admin - or (transfer.source == user.username) - or (transfer.uploader == user.username) - ) + authorized = user.is_admin + + # IncomingTransfers + try: + authorized = ( + authorized + or (transfer.source == user.username) + or (transfer.uploader == user.username) + ) + except AttributeError: + pass # OutgoingTransfers try: @@ -125,11 +131,17 @@ def get_status_by_id( for transfer_id in transfer_ids: transfer = session.get(transfer_type, transfer_id, with_for_update=True) - authorized = ( - user.is_admin - or (transfer.source == user.username) - or (transfer.uploader == user.username) - ) + authorized = user.is_admin + + # IncomingTransfers + try: + authorized = ( + authorized + or (transfer.source == user.username) + or (transfer.uploader == user.username) + ) + except AttributeError: + pass # OutgoingTransfers try: