added participation acceptance field
This commit is contained in:
@@ -56,6 +56,10 @@ class AbstractParticipant(models.Model):
|
||||
privacy_policy_accepted = models.BooleanField(default=False,
|
||||
verbose_name=_('Einwilligung zur Datenspeicherung'))
|
||||
|
||||
participation_conditions_accepted = models.BooleanField(default=False,
|
||||
verbose_name=_('Einwilligung der Teilnahmebedingungen'))
|
||||
|
||||
|
||||
paid = models.BooleanField('Teilnehmerbeitrag bezahlt', default=False)
|
||||
|
||||
purge_at = models.DateTimeField()
|
||||
|
||||
@@ -51,7 +51,7 @@ class RegistrationForm(forms.ModelForm):
|
||||
' Das finden wir gut,'
|
||||
' aber bitte melde dich besser mal per E-Mail bei uns.'),
|
||||
params={'max_age': max_age},
|
||||
code='to_old',
|
||||
code='too_old',
|
||||
)
|
||||
return val
|
||||
|
||||
@@ -79,6 +79,16 @@ class RegistrationForm(forms.ModelForm):
|
||||
)
|
||||
return val
|
||||
|
||||
def clean_participation_conditions_accepted(self):
|
||||
val = self.cleaned_data.get('participation_conditions_accepted')
|
||||
if not val:
|
||||
raise forms.ValidationError(
|
||||
ugettext('Um an dieser Veranstaltung teilnehmen zu können,'
|
||||
' musst du die Teilnahmebedingungen akzeptieren.'),
|
||||
code='participation_conditions_not_accepted',
|
||||
)
|
||||
return val
|
||||
|
||||
def clean(self):
|
||||
super().clean()
|
||||
dav_member = self.cleaned_data.get('dav_member')
|
||||
|
||||
@@ -84,6 +84,8 @@ class Registration(models.Model):
|
||||
verbose_name=_('Einwilligung zur Datenspeicherung'))
|
||||
purge_at = models.DateTimeField(_('Zeitpunkt der Datenlöschung'))
|
||||
|
||||
participation_conditions_accepted = models.BooleanField(default=False, verbose_name=_('Einwilligung der Teilnahmebedingungen'))
|
||||
|
||||
answered_obsolete = models.BooleanField(default=False, verbose_name=_('Durch Tourleitung beantwortet'))
|
||||
|
||||
def approx_age(self):
|
||||
|
||||
@@ -182,6 +182,23 @@
|
||||
Der/die Tourenleiter/in wird dir also persönlich per E-Mail zu- oder absagen.
|
||||
</small></p>
|
||||
</div>
|
||||
{% if form.participation_conditions_accepted.errors %}
|
||||
<div class="has-error">
|
||||
{% endif %}
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="participation_conditions_accepted" {% if form.participation_conditions_accepted.value %}checked="checked"{% endif %}>
|
||||
{% trans 'Ich habe den oben erläuterten Teilnahmevorbehalt und die <a href="">Teilnahmebedingungen</a> gelesen und akzeptiert.' %}
|
||||
</label>
|
||||
</div>
|
||||
{% if form.participation_conditions_accepted.errors %}
|
||||
<div class="help-block">
|
||||
{% for error in form.participation_conditions_accepted.errors %}
|
||||
<p>{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
|
||||
Reference in New Issue
Block a user