Skip to content
Snippets Groups Projects
Commit 84483050 authored by grollicus's avatar grollicus
Browse files

disallow setting state_assembly=state_channel=none

parent f07124ee
No related branches found
No related tags found
No related merge requests found
......@@ -126,6 +126,11 @@ class AssemblyEditForm(forms.ModelForm):
# call original .clean() which e.g. removes 'slug' from cleaned_data if that isn't a slug
super().clean()
# ensure assembly is either a channel or an assembly
if self.cleaned_data.get('state_assembly') == Assembly.State.NONE and self.cleaned_data.get('state_channel') == Assembly.State.NONE:
self.add_error('state_assembly', _('Assembly__states_must_not_be_none'))
self.add_error('state_channel', _('Assembly__states_must_not_be_none'))
# slug must not already exist in the conference
slug = self.cleaned_data.get('slug')
if slug is not None and Assembly.objects.filter(conference=self.instance.conference, slug=slug).exclude(pk=self.instance.pk).exists():
......
......@@ -255,6 +255,9 @@ msgstr "Die Assembly muss einen Typ haben (zumindest eins von physisch/virtuell/
msgid "Assembly__technical_user__must_be_assembly"
msgstr "Der technische Benutzer muss vom Typ 'Assembly' sein."
msgid "Assembly__states_must_not_be_none"
msgstr "Assemblystate oder Channelstate muss gesetzt sein!"
msgid "Assembly__slug__is_forbidden"
msgstr "Dieser Kurzname ist verboten!"
......
......@@ -255,6 +255,9 @@ msgstr "The assembly requires a type (at least one of physical/virtual/remote)."
msgid "Assembly__technical_user__must_be_assembly"
msgstr "The technical user must be of type 'assembly'."
msgid "Assembly__states_must_not_be_none"
msgstr "assembly state or channel state must be set!"
msgid "Assembly__slug__is_forbidden"
msgstr "this short name is forbidden"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment