Captcha hinzugefügt und gecheckt
This commit is contained in:
parent
8b23a6301b
commit
4b891f5829
Binary file not shown.
Binary file not shown.
|
|
@ -89,6 +89,7 @@ INSTALLED_APPS = [
|
||||||
'channels',
|
'channels',
|
||||||
'channels_presence',
|
'channels_presence',
|
||||||
'simple_history',
|
'simple_history',
|
||||||
|
'captcha'
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ urlpatterns = [
|
||||||
path('api-token-auth/', obtain_auth_token, name='api-token-auth'),
|
path('api-token-auth/', obtain_auth_token, name='api-token-auth'),
|
||||||
path('getdoc/<path:path>/<int:agpk>', GetCryptFileRecover.as_view(), name=FETCH_URL_NAME),
|
path('getdoc/<path:path>/<int:agpk>', GetCryptFileRecover.as_view(), name=FETCH_URL_NAME),
|
||||||
path('getdoc/<path:path>', GetCryptFile.as_view(), name=FETCH_URL_NAME),
|
path('getdoc/<path:path>', GetCryptFile.as_view(), name=FETCH_URL_NAME),
|
||||||
|
path('captcha/', include('captcha.urls')),
|
||||||
|
|
||||||
|
|
||||||
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
||||||
|
|
|
||||||
|
|
@ -31,4 +31,5 @@ python-dateutil==2.8.1
|
||||||
django-simple-history==2.11.0
|
django-simple-history==2.11.0
|
||||||
django-encrypted-filefield==0.2.2
|
django-encrypted-filefield==0.2.2
|
||||||
more-itertools==8.5.0
|
more-itertools==8.5.0
|
||||||
django-passwords==0.3.12
|
django-passwords==0.3.12
|
||||||
|
django-simple-captcha=0.5.13
|
||||||
|
|
@ -25,22 +25,25 @@
|
||||||
</legend>
|
</legend>
|
||||||
|
|
||||||
{% for field in form %}
|
{% for field in form %}
|
||||||
{{field.field_name}}
|
|
||||||
{% if field.name == 'agb' %}
|
{% if field.name != 'captcha' %}
|
||||||
{{field}} <a style="" href="{% url 'datenschutzda' %}" target="_blank">AGB's*</a><br />
|
{{field.field_name}}
|
||||||
{% elif field.name == 'av' %}
|
{% if field.name == 'agb' %}
|
||||||
{{field}} <a style="" href="{% url 'impressumda' %}" target="_blank">Auftragsverarbeitung*</a>
|
{{field}} <a style="" href="{% url 'datenschutzda' %}" target="_blank">AGB's*</a><br />
|
||||||
{% else %}
|
{% elif field.name == 'av' %}
|
||||||
{{field|as_crispy_field}}
|
{{field}} <a style="" href="{% url 'impressumda' %}" target="_blank">Auftragsverarbeitung*</a>
|
||||||
|
{% else %}
|
||||||
|
{{field|as_crispy_field}}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{{form.captcha|as_crispy_field}}
|
||||||
<div class="form-check">
|
<!--<div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox" value="" id="isvve" onclick="javascript:changeVVE()">
|
<input class="form-check-input" type="checkbox" value="" id="isvve" onclick="javascript:changeVVE()">
|
||||||
<label class="form-check-label" for="isvve">
|
<label class="form-check-label" for="isvve">
|
||||||
VVE-Mitglied
|
VVE-Mitglied
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>-->
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-success">Registrieren</button>
|
<button type="submit" class="btn btn-success">Registrieren</button>
|
||||||
|
|
@ -49,7 +52,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function(){
|
/*$(document).ready(function(){
|
||||||
$("#div_id_vve").hide();
|
$("#div_id_vve").hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -61,6 +64,6 @@
|
||||||
} else {
|
} else {
|
||||||
$("#div_id_vve").hide();
|
$("#div_id_vve").hide();
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
</script>
|
</script>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
@ -8,6 +8,8 @@ from areas.models import Areas
|
||||||
from tasks.models import Tasks
|
from tasks.models import Tasks
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from django.utils.translation import gettext as _
|
from django.utils.translation import gettext as _
|
||||||
|
from captcha.fields import CaptchaField
|
||||||
|
|
||||||
|
|
||||||
# Standard-User-Formular - NUR Username und Password wird hier genutzt
|
# Standard-User-Formular - NUR Username und Password wird hier genutzt
|
||||||
class UsersAddNewUser(UserCreationForm):
|
class UsersAddNewUser(UserCreationForm):
|
||||||
|
|
@ -174,14 +176,22 @@ class SupportForm(forms.Form):
|
||||||
#self.fields["attachment_3"] = forms.FileField(label="Anhang 3", required=False)
|
#self.fields["attachment_3"] = forms.FileField(label="Anhang 3", required=False)
|
||||||
|
|
||||||
class NewAgencyForm(forms.Form):
|
class NewAgencyForm(forms.Form):
|
||||||
|
|
||||||
|
captcha = CaptchaField()
|
||||||
|
|
||||||
|
fields = ['first_name','last_name','mail','agencyname','vve','agb','av','captcha']
|
||||||
|
field_order = ['first_name','last_name','mail','agencyname','vve','agb','av','captcha']
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.fields['first_name'] = forms.CharField(required=True, label="Vorname")
|
self.fields['first_name'] = forms.CharField(required=True, label="Vorname")
|
||||||
self.fields['last_name'] = forms.CharField(required=True, label="Nachname")
|
self.fields['last_name'] = forms.CharField(required=True, label="Nachname")
|
||||||
self.fields['mail'] = forms.EmailField(required=True, label="E-Mail")
|
self.fields['mail'] = forms.EmailField(required=True, label="E-Mail")
|
||||||
self.fields['agencyname'] = forms.CharField(required=True, label="Agenturname")
|
self.fields['agencyname'] = forms.CharField(required=True, label="Agenturname")
|
||||||
self.fields['vve'] = forms.CharField(required=False, label="VVE-Mitgliedsnummer")
|
self.fields['vve'] = forms.CharField(required=True, label="VVE-Mitgliedsnummer")
|
||||||
self.fields['agb'] = forms.BooleanField(required=True, label="AGB's")
|
self.fields['agb'] = forms.BooleanField(required=True, label="AGB's")
|
||||||
self.fields['av'] = forms.BooleanField(required=True, label="Auftragsverarbeitung")
|
self.fields['av'] = forms.BooleanField(required=True, label="Auftragsverarbeitung")
|
||||||
|
self.fields['captcha'] = CaptchaField(required=True, label="Bitte geben Sie die Symbole ein.")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue