Skip to content

Commit c1a02e0

Browse files
committed
Guard against empty studyForm
1 parent 6241a76 commit c1a02e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nmdc_server/api.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,8 @@ async def update_submission(
825825
submission.metadata_submission = (
826826
submission.metadata_submission | body_dict["metadata_submission"]
827827
)
828-
submission.study_name = body_dict["metadata_submission"]["studyForm"]["studyName"]
828+
if "studyForm" in body_dict["metadata_submission"]:
829+
submission.study_name = body_dict["metadata_submission"]["studyForm"]["studyName"]
829830
# Update permissions and status iff the user is an "owner"
830831
if current_user_role and current_user_role.role == models.SubmissionEditorRole.owner:
831832
new_permissions = body_dict.get("permissions", None)

0 commit comments

Comments
 (0)