Skip to content

Commit

Permalink
add validate error in case of future validation
Browse files Browse the repository at this point in the history
  • Loading branch information
BradleySappington committed Jul 29, 2024
1 parent ec1d4f0 commit 2e9a683
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 @@ -45,7 +45,7 @@
from astropy.time import Time
from astroquery.mast import Mast
from bs4 import BeautifulSoup
from django import setup
from django import forms, setup
from django.conf import settings
from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
Expand Down Expand Up @@ -756,6 +756,8 @@ def get_exp_comment_form(request, file_root):
for rootfileinfo in rootfileinfo_set:
rootfileinfo.exp_comment = exp_comment_form.cleaned_data['exp_comment']
rootfileinfo.save()
else:
raise forms.ValidationError("Invalid content!")
else:
exp_comment_form = RootFileInfoExposureCommentSubmitForm(instance=rootfileinfo_set.first())

Expand Down

0 comments on commit 2e9a683

Please sign in to comment.