Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
fc7610c4
Verified
Commit
fc7610c4
authored
May 08, 2019
by
Sébastiaan Versteeg
Browse files
Fix crash when ForeignKey is left empty on model save
parent
54be22a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/events/models.py
View file @
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
()):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment