Skip to content

Commit

Permalink
add error message
Browse files Browse the repository at this point in the history
  • Loading branch information
BradleySappington committed Jul 29, 2024
1 parent 2e9a683 commit 01c4940
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jwql/website/apps/jwql/data_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,8 @@ def get_comment_form(request, file_root):
comment_form = RootFileInfoCommentSubmitForm(request.POST, instance=root_file_info)
if comment_form.is_valid():
comment_form.save()
else:
messages.error(request, "Failed to update comment form")
else:
comment_form = RootFileInfoCommentSubmitForm(instance=root_file_info)

Expand Down Expand Up @@ -757,7 +759,7 @@ def get_exp_comment_form(request, file_root):
rootfileinfo.exp_comment = exp_comment_form.cleaned_data['exp_comment']
rootfileinfo.save()
else:
raise forms.ValidationError("Invalid content!")
messages.error(request, "Failed to update exposure comment form")
else:
exp_comment_form = RootFileInfoExposureCommentSubmitForm(instance=rootfileinfo_set.first())

Expand Down

0 comments on commit 01c4940

Please sign in to comment.