Skip to content

Commit f20e3fd

Browse files
committed
Sanitise inputs
1 parent 72201ec commit f20e3fd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/murfey/util/tomo_metadata.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from murfey.server import _transport_object
77
from murfey.server.api.auth import MurfeySessionIDInstrument as MurfeySessionID
88
from murfey.server.gain import Camera
9+
from murfey.util import sanitise
910
from murfey.util.config import get_machine_config
1011
from murfey.util.db import DataCollectionGroup, SearchMap
1112
from murfey.util.db import Session as MurfeySession
@@ -215,7 +216,9 @@ def register_search_map_in_database(
215216
if _transport_object:
216217
_transport_object.do_update_search_map(search_map.id, search_map_params)
217218
else:
218-
logger.info(f"Unable to register search map {search_map_name} position yet")
219+
logger.info(
220+
f"Unable to register search map {sanitise(search_map_name)} position yet"
221+
)
219222
murfey_db.add(search_map)
220223
murfey_db.commit()
221224
murfey_db.close()
@@ -241,7 +244,9 @@ def register_batch_position_in_database(
241244
.where(TiltSeries.session_id == session_id)
242245
).one()
243246
if tilt_series.x_location:
244-
logger.info(f"Already did position analysis for tomogram {batch_name}")
247+
logger.info(
248+
f"Already did position analysis for tomogram {sanitise(batch_name)}"
249+
)
245250
return
246251
except Exception:
247252
tilt_series = TiltSeries(
@@ -331,7 +336,7 @@ def register_batch_position_in_database(
331336
)
332337
else:
333338
logger.warning(
334-
f"No search map information available to register position of {batch_name}"
339+
f"No search map information available to register position of {sanitise(batch_name)}"
335340
)
336341
murfey_db.add(tilt_series)
337342
murfey_db.commit()

0 commit comments

Comments
 (0)