Browse Source

intern view now works with django 3.2, too

master
Benni Baermann 3 years ago
parent
commit
a23ffdf67f
3 changed files with 34 additions and 2 deletions
  1. +2
    -2
      input/forms.py
  2. +28
    -0
      input/migrations/0061_concretevolunteer.py
  3. +4
    -0
      input/models.py

+ 2
- 2
input/forms.py View File

@ -3,7 +3,7 @@ from django.forms import ModelForm, DateField, ChoiceField, RadioSelect, Boolean
from django.contrib.admin.widgets import AdminDateWidget from django.contrib.admin.widgets import AdminDateWidget
from django.utils.html import format_html from django.utils.html import format_html
from .models import Project, Volunteer, Extern, ConcreteExtern, IFG, Library, TYPE_CHOICES,\
from .models import Project, Volunteer, ConcreteVolunteer, Extern, ConcreteExtern, IFG, Library, TYPE_CHOICES,\
HonoraryCertificate, Travel, Email, Literature, List,\ HonoraryCertificate, Travel, Email, Literature, List,\
BusinessCard BusinessCard
from .settings import DATAPROTECTION, FOERDERRICHTLINIEN, NUTZUNGSBEDINGUNGEN from .settings import DATAPROTECTION, FOERDERRICHTLINIEN, NUTZUNGSBEDINGUNGEN
@ -48,7 +48,7 @@ class InternForm(FdbForm):
label = 'Was möchtest Du eingeben?') label = 'Was möchtest Du eingeben?')
class Meta: class Meta:
model = Volunteer
model = ConcreteVolunteer
exclude = ('granted', 'granted_date', 'survey_mail_send', 'survey_mail_date') exclude = ('granted', 'granted_date', 'survey_mail_send', 'survey_mail_date')
class TravelForm(FdbForm): class TravelForm(FdbForm):

+ 28
- 0
input/migrations/0061_concretevolunteer.py View File

@ -0,0 +1,28 @@
# Generated by Django 3.2.5 on 2021-07-07 07:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('input', '0060_concreteextern'),
]
operations = [
migrations.CreateModel(
name='ConcreteVolunteer',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('realname', models.CharField(help_text='Bitte gib deinen Vornamen und deinen Nachnamen ein.', max_length=200, null=True, verbose_name='Realname')),
('email', models.EmailField(help_text='Bitte gib deine E-Mail-Adresse ein, damit dich<br>Wikimedia Deutschland bei Rückfragen oder für<br>die Zusage kontaktieren kann.', max_length=200, null=True, verbose_name='E-Mail-Adresse')),
('granted', models.BooleanField(null=True)),
('granted_date', models.DateField(null=True)),
('survey_mail_send', models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken')),
('survey_mail_date', models.DateField(blank=True, null=True, verbose_name='Umfragemail wurde verschickt am')),
],
options={
'abstract': False,
},
),
]

+ 4
- 0
input/models.py View File

@ -96,6 +96,10 @@ class Intern(Volunteer):
class Meta: class Meta:
abstract = True abstract = True
class ConcreteVolunteer(Volunteer):
''' needed because we can't initiate abstract base classes in the view'''
pass
class HonoraryCertificate(Intern): class HonoraryCertificate(Intern):
''' this class is also used for accreditations ''' ''' this class is also used for accreditations '''

Loading…
Cancel
Save