Skip to content

Commit 54d6e7f

Browse files
committed
Use SCAUP token for upserting orphan samples
1 parent 7c8f16b commit 54d6e7f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/scaup/crud/shipments.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ def create_all_items_in_shipment(
112112
)
113113

114114
for sample in containerless_samples:
115-
Expeye.upsert(token, sample, None, session_id)
115+
# There is no way of verifying orphan sample ownership in ISPyB, so we need to use SCAUP's
116+
# token instead to create them on behalf of SCAUP, which has permission to manipulate all samples.
117+
# TODO: revisit this when SCAUP creates containers, dewars and shipments for orphan samples
118+
Expeye.upsert(Config.ispyb_api.jwt, sample, None, session_id)
116119

117120
modified_items = list(create_all_items_in_shipment(shipment, f"{shipment.proposalCode}{shipment.proposalNumber}"))
118121

0 commit comments

Comments
 (0)