diff --git a/AKSubmission/forms.py b/AKSubmission/forms.py index 3152a4cecd9fe919543d07a5ffd9b69944d6c6a2..a964d6ed0fc0d4f83934e905341b062ce76be78a 100644 --- a/AKSubmission/forms.py +++ b/AKSubmission/forms.py @@ -1,4 +1,5 @@ import itertools +import re from django import forms from django.core.exceptions import ValidationError @@ -10,6 +11,7 @@ from AKModel.models import AK, AKOwner, AKCategory, AKRequirement, AKSlot class AKForm(AvailabilitiesFormMixin, forms.ModelForm): required_css_class = 'required' + split_string = re.compile('[,;]') class Meta: model = AK @@ -42,7 +44,7 @@ class AKForm(AvailabilitiesFormMixin, forms.ModelForm): self.fields["conflicts"].widget.attrs = {'class': 'chosen-select'} self.fields["prerequisites"].widget.attrs = {'class': 'chosen-select'} - help_tags_addition = _('Separate multiple tags with semicolon') + help_tags_addition = _('Separate multiple tags with comma or semicolon') # Add text fields for tags self.fields["tags_raw"] = forms.CharField( @@ -98,7 +100,9 @@ class AKForm(AvailabilitiesFormMixin, forms.ModelForm): cleaned_data["short_name"] = short_name # Get tag names from raw tags - cleaned_data["tag_names"] = [name.strip().lower() for name in cleaned_data["tags_raw"].split(";")] + cleaned_data["tag_names"] = [name.strip().lower() for name + in self.split_string.split(cleaned_data["tags_raw"]) + if name.strip() != ''] # Get durations from raw durations field if "durations" in cleaned_data: diff --git a/AKSubmission/locale/de_DE/LC_MESSAGES/django.po b/AKSubmission/locale/de_DE/LC_MESSAGES/django.po index ae0d39713bbc12010a247073f4add073df9c69e0..57f061e598004e5acdb929c360c1f586a4b871a8 100644 --- a/AKSubmission/locale/de_DE/LC_MESSAGES/django.po +++ b/AKSubmission/locale/de_DE/LC_MESSAGES/django.po @@ -2,13 +2,13 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. -# +# #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 20:46+0000\n" +"POT-Creation-Date: 2020-05-20 12:18+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -17,20 +17,20 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: AKSubmission/forms.py:45 -msgid "Separate multiple tags with semicolon" -msgstr "Mehrere Tags mit Semikolon trennen" +#: AKSubmission/forms.py:47 +msgid "Separate multiple tags with comma or semicolon" +msgstr "Mehrere Tags mit Komma oder Semikolon trennen" -#: AKSubmission/forms.py:75 +#: AKSubmission/forms.py:77 #, python-format msgid "\"%(duration)s\" is not a valid duration" msgstr "\"%(duration)s\" ist keine gültige Dauer" -#: AKSubmission/forms.py:118 +#: AKSubmission/forms.py:122 msgid "Duration(s)" msgstr "Dauer(n)" -#: AKSubmission/forms.py:120 +#: AKSubmission/forms.py:124 msgid "" "Enter at least one planned duration (in hours). If your AK should have " "multiple slots, use multiple lines" diff --git a/locale/de_DE/LC_MESSAGES/django.po b/locale/de_DE/LC_MESSAGES/django.po index 9c902594bed0a547e3138d9e7151d32eabb44ecc..17b3aae760e41a32807eaddeb4c3515bf3bbc3ed 100644 --- a/locale/de_DE/LC_MESSAGES/django.po +++ b/locale/de_DE/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 21:50+0000\n" +"POT-Creation-Date: 2020-05-20 12:18+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -46,15 +46,15 @@ msgstr "Anzahl" msgid "Event Status" msgstr "Event-Status" -#: templates/base.html:28 +#: templates/base.html:29 msgid "" "Are you sure you want to change the language now? This will clear the form!" msgstr "Wirklich jetzt die Sprache ändern? Das wird das Formular zurücksetzen!" -#: templates/base.html:97 +#: templates/base.html:99 msgid "Impress" msgstr "Impressum" -#: templates/base.html:100 +#: templates/base.html:102 msgid "This software is open source" msgstr "Diese Software ist Open Source"