Skip to content

Commit 1d6ae63

Browse files
committed
Allow none acquisition ids for when smartem is inactive
1 parent 07627c2 commit 1d6ae63

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/murfey/server/api/session_control.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def get_foil_hole(
359359

360360
class AtlasRegistration(BaseModel):
361361
name: str
362-
acquisition_uuid: str
362+
acquisition_uuid: str | None
363363
storage_folder: str = ""
364364
register_grid: bool = False
365365
tag: str = ""
@@ -371,7 +371,7 @@ def register_atlas(
371371
atlas_registration_data: AtlasRegistration,
372372
db=murfey_db,
373373
):
374-
if SMARTEM_ACTIVE:
374+
if SMARTEM_ACTIVE and atlas_registration_data.acquisition_uuid is not None:
375375
session = db.exec(select(Session).where(Session.id == session_id)).one()
376376
machine_config = get_machine_config(session.instrument_name)[
377377
session.instrument_name
@@ -410,7 +410,9 @@ def register_atlas(
410410
if atlas_registration_data.register_grid:
411411
smartem_client.grid_registered(grid_uuid)
412412
else:
413-
logger.info("smartem deactivated so did not register atlas")
413+
logger.info(
414+
f"smartem deactivated so did not register atlas for {atlas_registration_data.acquisition_uuid}"
415+
)
414416

415417

416418
class SquareRegistration(BaseModel):

0 commit comments

Comments
 (0)