From c7bde110a7955c566d89c1830092fe2514d99431 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 27 Oct 2020 15:50:46 +0100 Subject: [PATCH] some changes (sorry, i lost track) --- input/migrations/0030_auto_20201027_1337.py | 23 +++++++++++++++++++++ input/models.py | 4 ++-- input/templates/input/if_mail.txt | 18 ++++++++-------- input/views.py | 2 ++ 4 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 input/migrations/0030_auto_20201027_1337.py diff --git a/input/migrations/0030_auto_20201027_1337.py b/input/migrations/0030_auto_20201027_1337.py new file mode 100644 index 0000000..2672dbe --- /dev/null +++ b/input/migrations/0030_auto_20201027_1337.py @@ -0,0 +1,23 @@ +# Generated by Django 3.1.1 on 2020-10-27 13:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('input', '0029_auto_20201027_1247'), + ] + + operations = [ + migrations.AlterField( + model_name='businesscard', + name='data', + field=models.CharField(default='', max_length=1000, verbose_name='Persönliche Daten'), + ), + migrations.AlterField( + model_name='businesscard', + name='sent_to', + field=models.CharField(default='', max_length=1000, verbose_name='Sendungsadresse'), + ), + ] diff --git a/input/models.py b/input/models.py index fa1cce9..7dc1bed 100644 --- a/input/models.py +++ b/input/models.py @@ -164,8 +164,8 @@ class BusinessCard(Extern): project = models.CharField(max_length=20, choices=PROJECT_CHOICE.items(), default='PEDIA', verbose_name='Wikimedia Projekt') - data = models.CharField(max_length=1000, verbose_name='Persönliche Daten', default='NODATA') + data = models.CharField(max_length=1000, verbose_name='Persönliche Daten', default='') variant = models.CharField(max_length=5, choices=BC_VARIANT.items(), default='NOPIC', verbose_name='Variante') sent_to = models.CharField(max_length=1000, verbose_name='Sendungsadresse', - default='NOADRESS') + default='') diff --git a/input/templates/input/if_mail.txt b/input/templates/input/if_mail.txt index 2895628..d51ee08 100644 --- a/input/templates/input/if_mail.txt +++ b/input/templates/input/if_mail.txt @@ -9,18 +9,15 @@ Der Nutzer mit dem Username {{data.username}} ({{data.email}}) fragt ein(e){% if {% elif data.choice == 'SOFT' %} Softwarestipendium {% elif data.choice == 'VIS' %} Visitenkarten {% elif data.choice == 'MAIL' %} Mailadresse -{% elif data.choice == 'LIST' %} Mailingliste -{% else %} ERROR UNKNOWN FORMTYPE {% endif %} an. +{% elif data.choice == 'LIST' %} Mailingliste {% else %} ERROR UNKNOWN FORMTYPE {% endif %} an. -{% if data.choice in ('BIB','ELIT','SOFT','LIT','IFG') %} +{% if data.choice in data.grant %} Vorraussichtliche Kosten: {{data.cost}} Anmerkungen: {{data.notes}} -{% endif %} -{% if data.choice in ('MAIL', 'LIST') %} +{% endif %} {% if data.choice in data.domain %} Domain: {{data.domain}} Adressenbestandteil: {{data.address}} -{% endif %} -{% if data.choice == 'BIB' %} +{% endif %} {% if data.choice == 'BIB' %} Bibliothek: {{data.library}} Dauer: {{data.duration}} {% elif data.choice == 'ELIT' %} @@ -40,8 +37,7 @@ Adressenbestandteil frei gewählt: {{data.other}} Wikimedia-Projekt: {{data.project}} Persönliche Daten: {{data.data}} Variante: {{data.variant}} -Sendungsadrese: {{data.send_to}} -{% endif %} +Sendungsadrese: {{data.send_to}} {% endif %} Zum Genehmigen hier klicken: {{data.urlprefix}}{% url 'authorize' data.choice data.pk %} @@ -50,6 +46,10 @@ Zu Ablehnen hier klicken: {{data.urlprefix}}{% url 'deny' data.choice data.pk %} Stets zu Diensten, Deine Förderdatenbank {% comment %} + +vielleicht brauchen wir das hier https://gist.github.com/martinsvoboda/1bf965a8c6037c0fe1a88d89ea822df6 + + alte mail: diff --git a/input/views.py b/input/views.py index 1c5480a..d960fc5 100644 --- a/input/views.py +++ b/input/views.py @@ -166,6 +166,8 @@ class ExternView(CookieWizardView): # add some data to context for mail templates data['pk'] = form.pk data['urlprefix'] = URLPREFIX + data['grant'] = ('LIT', 'SOFT', 'ELIT', 'BIB', 'IFG') + data['DOMAIN'] = ('MAIL', 'LIST') # we need to send the following mails here: context = { 'data': data }