#85: New import option: set status of all imported applications to 'permit'

This commit is contained in:
René Köcher 2012-04-13 21:55:13 +02:00
parent 639397028e
commit 113d258b3d
4 changed files with 18 additions and 6 deletions

View File

@ -56,7 +56,7 @@ class ApplicationManagerForm(ModelForm, CssClassMixin):
class ApplicationImportForm(Form, CssClassMixin):
csvfile = FileField(widget=FileInput(attrs={'size':'50'}), label=_("CSV File"))
import_permitted = BooleanField(required=False, label=_("Import applications with status \"permitted\""), help_text=_("Set the initial status for each application to \"permitted\""))
class ConfigForm(Form, CssClassMixin):
application_min_supporters = IntegerField(

View File

@ -495,6 +495,7 @@ def application_import(request):
if request.method == 'POST':
form = ApplicationImportForm(request.POST, request.FILES)
if form.is_valid():
import_permitted = form.cleaned_data['import_permitted']
try:
users_generated = 0
applications_generated = 0
@ -563,6 +564,9 @@ def application_import(request):
application.title = form.cleaned_data['title']
application.text = form.cleaned_data['text']
application.reason = form.cleaned_data['reason']
if import_permitted:
application.status = 'per'
application.save(user, trivial_change=True)
if applications_generated:

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-04-12 16:50+0200\n"
"POT-Creation-Date: 2012-04-13 21:24+0200\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,11 +17,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
#: openslides_settings.py:42 settings.py:60
#: openslides_settings.py:42
msgid "German"
msgstr "Deutsch"
#: openslides_settings.py:43 settings.py:61
#: openslides_settings.py:43
msgid "English"
msgstr "Englisch"
@ -246,14 +246,14 @@ msgstr "Triviale Änderung"
msgid "Trivial changes don't create a new version."
msgstr "Triviale Änderungen erzeugen keine neue Version."
#: application/forms.py:49 application/models.py:53
#: application/forms.py:49 application/models.py:54
#: application/templates/application/overview.html:39
#: application/templates/application/view.html:13
#: application/templates/projector/Application.html:22 utils/pdf.py:311
msgid "Submitter"
msgstr "Antragsteller/in"
#: application/forms.py:50 application/models.py:55
#: application/forms.py:50 application/models.py:56
#: application/templates/application/view.html:27 utils/pdf.py:324
msgid "Supporters"
msgstr "Unterstützer/innen"
@ -262,6 +262,14 @@ msgstr "Unterstützer/innen"
msgid "CSV File"
msgstr "CSV-Datei"
#: application/forms.py:59
msgid "Import applications with status \"permitted\""
msgstr "Anträge als \"Zugelassen\" importieren"
#: application/forms.py:59
msgid "Set the initial status for each application to \"permitted\""
msgstr "Setzt den initialen Status für jeden Antrag auf \"zugelassen\""
#: application/forms.py:64
msgid "Number of (minimum) required supporters for a application"
msgstr "Mindestanzahl erforderlicher Unterstützer/innen für einen Antrag"