Skip to content
GitLab
Menu
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
f96029bf
Verified
Commit
f96029bf
authored
Mar 22, 2017
by
Sébastiaan Versteeg
Browse files
Fix registration message validation
parent
2ce7dd2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/events/models.py
View file @
f96029bf
...
...
@@ -8,6 +8,7 @@ from django.utils.translation import ugettext_lazy as _
from
django.utils.translation
import
string_concat
from
tinymce.models
import
HTMLField
from
thaliawebsite.settings
import
settings
from
utils.translation
import
ModelTranslateMeta
,
MultilingualField
...
...
@@ -167,11 +168,12 @@ class Event(models.Model, metaclass=ModelTranslateMeta):
errors
.
update
({
'end'
:
_
(
"Can't have an event travel back in time"
)})
if
self
.
registration_required
():
if
self
.
no_registration_message
:
errors
.
update
(
{
'no_registration_message'
:
_
(
"Doesn't make sense to have this if you require "
"registrations."
)})
for
lang
in
settings
.
LANGUAGES
:
field
=
'no_registration_message_'
+
lang
[
0
]
if
getattr
(
self
,
field
):
errors
.
update
(
{
field
:
_
(
"Doesn't make sense to have this "
"if you require registrations."
)})
if
not
self
.
registration_start
:
errors
.
update
(
{
'registration_start'
:
_
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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