User must confirm that he have read and understood the privacy plicity. This policity and the stautes are now linked in the help_text.

This commit is contained in:
2018-05-08 12:07:39 +02:00
parent 436a77d036
commit f841c1736e
2 changed files with 16 additions and 3 deletions

View File

@@ -5,8 +5,8 @@
<label {% if field.html_name != 'recaptcha' %} for="id_{{ field.html_name}}" {% endif %} <label {% if field.html_name != 'recaptcha' %} for="id_{{ field.html_name}}" {% endif %}
class="field_name {{ field.css_classes }}">{{ field.label}}</label> class="field_name {{ field.css_classes }}">{{ field.label}}</label>
{{ field }} {{ field }}
{% if field.help_text and not field.field.widget.input_type %} {% if field.field.widget.input_type == 'checkbox' %}
{{field.help_text}} <label for="id_{{field.name}}">{{field.help_text|safe}}</label>
{% elif field.help_text %} {% elif field.help_text %}
<p class="help_text">{{field.help_text}}</p> <p class="help_text">{{field.help_text}}</p>
{% endif %} {% endif %}

View File

@@ -10,9 +10,10 @@ from django.conf import settings
from django.contrib import auth from django.contrib import auth
from django.contrib.sites.models import Site from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.utils.safestring import mark_safe
from utils.massmailer import MassMailer from utils.massmailer import MassMailer
from . import models from . import models
from content.models import Page
class MembershipForm(forms.ModelForm): class MembershipForm(forms.ModelForm):
@@ -68,6 +69,18 @@ class RegistrationForm(MembershipForm):
widget=forms.PasswordInput(), label=_('password')) widget=forms.PasswordInput(), label=_('password'))
password2 = forms.CharField( password2 = forms.CharField(
widget=forms.PasswordInput(), label=_('password (again)')) widget=forms.PasswordInput(), label=_('password (again)'))
privacy_policy = forms.BooleanField(
label=_('Privacy policy'),
help_text=_(
'I have read and understood the <a href="%s">privacy policy</a>') %
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 '
'<a href="%s">statutes</a> and would like to become a member.') %
Page.objects.get(slug='statutes').get_absolute_url())
recaptcha = ReCaptchaField() recaptcha = ReCaptchaField()
class Meta: class Meta: