Skip to content

Commit

Permalink
Incorrect uploader/source terminology fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JBorrow committed Jul 19, 2024
1 parent 2f016b6 commit a48a9a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions librarian_server/api/checkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ def modify_transfers_by_id(
reasons.add("No destination transfer with the appropriate ID was found.")
continue

authorized = user.is_admin or (transfer.uploader == user.username)
authorized = (
user.is_admin
or (transfer.source == user.username)
or (transfer.uploader == user.username)
)

if not authorized:
unprocessed.append(transfer_id)
Expand Down Expand Up @@ -115,7 +119,11 @@ 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.uploader == user.username)
authorized = (
user.is_admin
or (transfer.source == user.username)
or (transfer.uploader == user.username)
)

status[transfer_id] = (
transfer.status if transfer is not None and authorized else None
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies = [
"checksumdir",
"cryptography",
"fastapi >= 0.108.0",
"globus-sdk",
"globus-sdk <= 3.40.0",
"httpx",
"pydantic >= 2",
"pydantic-settings >= 2",
Expand Down

0 comments on commit a48a9a0

Please sign in to comment.