Commit ecf7b09a authored by Thijs de Jong's avatar Thijs de Jong
Browse files

Merge branch 'fix/organiser-save-crash' into 'master'

Fix crash when ForeignKey is left empty on model save

Closes #866

See merge request !1248
parents c1ba1e80 fc7610c4
......@@ -293,12 +293,18 @@ class Event(models.Model, metaclass=ModelTranslateMeta):
errors.update({
'registration_start': message,
'registration_end': message})
if (self.organiser is not None and
self.send_cancel_email and
self.organiser.contact_mailinglist is None):
errors.update(
{'send_cancel_email': _("This organiser does not "
"have a contact mailinglist.")})
try:
if (self.organiser is not None and
self.send_cancel_email and
self.organiser.contact_mailinglist is None):
errors.update(
{'send_cancel_email': _(
"This organiser does not "
"have a contact mailinglist.")})
except ObjectDoesNotExist:
pass
if self.published:
if (self.price != self._price and self._registration_start
and self._registration_start <= timezone.now()):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment