Skip to content

Commit

Permalink
fix: target loader can process most recent data
Browse files Browse the repository at this point in the history
  • Loading branch information
kaliif committed Nov 14, 2023
1 parent 36559f2 commit 7f598ad
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions viewer/target_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,10 +814,17 @@ def process_metadata(

# add xtalform fk to experiment
for _, obj in experiment_objects.items():
obj.instance.xtalform = xtalform_objects[
assigned_xtalforms[obj.instance.code]
].instance
obj.instance.save()
try:
obj.instance.xtalform = xtalform_objects[
assigned_xtalforms[obj.instance.code]
].instance
obj.instance.save()
except KeyError:
# TODO: don't know at this point whether ignoring this
# error is a right thing to do
msg = f"xtalform {obj.instance.code} undefined for {obj}"
result.append(msg)
logger.warning(msg)

quat_assembly_objects = {}
for idx, obj in assemblies.items():
Expand Down Expand Up @@ -1332,6 +1339,8 @@ def load_target(
update_task(task, "SUCCESS", upload_report)
target_loader.experiment_upload.message = upload_report

logger.debug("%s", upload_report)

target_loader.experiment_upload.save()


Expand Down

0 comments on commit 7f598ad

Please sign in to comment.