From f841c1736edca1f66b6de3332daf6d882c19dc22 Mon Sep 17 00:00:00 2001 From: Christian Berg Date: Tue, 8 May 2018 12:07:39 +0200 Subject: [PATCH] User must confirm that he have read and understood the privacy plicity. This policity and the stautes are now linked in the help_text. --- src/kasu/templates/form.html | 4 ++-- src/membership/forms.py | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/kasu/templates/form.html b/src/kasu/templates/form.html index 8175adc..b3a070d 100644 --- a/src/kasu/templates/form.html +++ b/src/kasu/templates/form.html @@ -5,8 +5,8 @@ {{ field }} - {% if field.help_text and not field.field.widget.input_type %} - {{field.help_text}} + {% if field.field.widget.input_type == 'checkbox' %} + {% elif field.help_text %}

{{field.help_text}}

{% endif %} diff --git a/src/membership/forms.py b/src/membership/forms.py index c685344..e996b3e 100644 --- a/src/membership/forms.py +++ b/src/membership/forms.py @@ -10,9 +10,10 @@ from django.conf import settings from django.contrib import auth from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ - +from django.utils.safestring import mark_safe from utils.massmailer import MassMailer from . import models +from content.models import Page class MembershipForm(forms.ModelForm): @@ -68,6 +69,18 @@ class RegistrationForm(MembershipForm): widget=forms.PasswordInput(), label=_('password')) password2 = forms.CharField( widget=forms.PasswordInput(), label=_('password (again)')) + privacy_policy = forms.BooleanField( + label=_('Privacy policy'), + help_text=_( + 'I have read and understood the privacy policy') % + Page.objects.get(slug='privacypolicy').get_absolute_url()) + membership = forms.BooleanField( + label=_('Membership'), + help_text=_( + 'Yes, I confirm that I am in agreement with the ' + 'statutes and would like to become a member.') % + Page.objects.get(slug='statutes').get_absolute_url()) + recaptcha = ReCaptchaField() class Meta: