Skip to content
Snippets Groups Projects
Commit 857e8cd5 authored by Nadja Geisler's avatar Nadja Geisler :sunny:
Browse files

Merge branch 'master' into 'feature-requirements-overview'

# Conflicts:
#   locale/de_DE/LC_MESSAGES/django.po
parents 62978368 8d4b7767
No related branches found
No related tags found
1 merge request!44Show info about requirements on event status page
Pipeline #4060 failed
import itertools import itertools
import re
from django import forms from django import forms
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
...@@ -10,6 +11,7 @@ from AKModel.models import AK, AKOwner, AKCategory, AKRequirement, AKSlot ...@@ -10,6 +11,7 @@ from AKModel.models import AK, AKOwner, AKCategory, AKRequirement, AKSlot
class AKForm(AvailabilitiesFormMixin, forms.ModelForm): class AKForm(AvailabilitiesFormMixin, forms.ModelForm):
required_css_class = 'required' required_css_class = 'required'
split_string = re.compile('[,;]')
class Meta: class Meta:
model = AK model = AK
...@@ -42,7 +44,7 @@ class AKForm(AvailabilitiesFormMixin, forms.ModelForm): ...@@ -42,7 +44,7 @@ class AKForm(AvailabilitiesFormMixin, forms.ModelForm):
self.fields["conflicts"].widget.attrs = {'class': 'chosen-select'} self.fields["conflicts"].widget.attrs = {'class': 'chosen-select'}
self.fields["prerequisites"].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 # Add text fields for tags
self.fields["tags_raw"] = forms.CharField( self.fields["tags_raw"] = forms.CharField(
...@@ -98,7 +100,9 @@ class AKForm(AvailabilitiesFormMixin, forms.ModelForm): ...@@ -98,7 +100,9 @@ class AKForm(AvailabilitiesFormMixin, forms.ModelForm):
cleaned_data["short_name"] = short_name cleaned_data["short_name"] = short_name
# Get tag names from raw tags # 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 # Get durations from raw durations field
if "durations" in cleaned_data: if "durations" in cleaned_data:
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package. # This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -17,20 +17,20 @@ msgstr "" ...@@ -17,20 +17,20 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: AKSubmission/forms.py:45 #: AKSubmission/forms.py:47
msgid "Separate multiple tags with semicolon" msgid "Separate multiple tags with comma or semicolon"
msgstr "Mehrere Tags mit Semikolon trennen" msgstr "Mehrere Tags mit Komma oder Semikolon trennen"
#: AKSubmission/forms.py:75 #: AKSubmission/forms.py:77
#, python-format #, python-format
msgid "\"%(duration)s\" is not a valid duration" msgid "\"%(duration)s\" is not a valid duration"
msgstr "\"%(duration)s\" ist keine gültige Dauer" msgstr "\"%(duration)s\" ist keine gültige Dauer"
#: AKSubmission/forms.py:118 #: AKSubmission/forms.py:122
msgid "Duration(s)" msgid "Duration(s)"
msgstr "Dauer(n)" msgstr "Dauer(n)"
#: AKSubmission/forms.py:120 #: AKSubmission/forms.py:124
msgid "" msgid ""
"Enter at least one planned duration (in hours). If your AK should have " "Enter at least one planned duration (in hours). If your AK should have "
"multiple slots, use multiple lines" "multiple slots, use multiple lines"
......
...@@ -55,6 +55,6 @@ msgstr "Wirklich jetzt die Sprache ändern? Das wird das Formular zurücksetzen! ...@@ -55,6 +55,6 @@ msgstr "Wirklich jetzt die Sprache ändern? Das wird das Formular zurücksetzen!
msgid "Impress" msgid "Impress"
msgstr "Impressum" msgstr "Impressum"
#: templates/base.html:100 #: templates/base.html:102
msgid "This software is open source" msgid "This software is open source"
msgstr "Diese Software ist Open Source" msgstr "Diese Software ist Open Source"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment