Skip to content

Commit

Permalink
Merge pull request #446 from xchem/m2m-1055
Browse files Browse the repository at this point in the history
fix: target loader can process most recent data
  • Loading branch information
kaliif authored Nov 14, 2023
2 parents 36559f2 + 7f598ad commit 30002cb
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 30002cb

Please sign in to comment.