Fix rigboard validation tests

This commit is contained in:
2020-09-29 17:41:01 +01:00
parent 70de16ed5c
commit 932180f99f
2 changed files with 31 additions and 77 deletions

View File

@@ -95,7 +95,7 @@ class EventCreate(generic.CreateView):
context['currentVAT'] = models.VatRate.objects.current_rate()
form = context['form']
if re.search(r'"-\d+"', form['items_json'].value()):
if hasattr(form, 'items_json') and re.search(r'"-\d+"', form['items_json'].value()):
messages.info(self.request, "Your item changes have been saved. Please fix the errors and save the event.")
# Get some other objects to include in the form. Used when there are errors but also nice and quick.