form fixed
This commit is contained in:
@@ -242,7 +242,11 @@ class EmailForm(forms.Form):
|
|||||||
email = forms.EmailField()
|
email = forms.EmailField()
|
||||||
subject = forms.CharField(max_length=255)
|
subject = forms.CharField(max_length=255)
|
||||||
message = forms.CharField(widget=forms.Textarea())
|
message = forms.CharField(widget=forms.Textarea())
|
||||||
captcha = ReCaptchaField(widget=ReCaptchaV3)
|
captcha = ReCaptchaField(widget=ReCaptchaV3(
|
||||||
|
attrs={
|
||||||
|
'required_score': 0.85,
|
||||||
|
}
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
disqualificationreasons = (
|
disqualificationreasons = (
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{% extends "newbase.html" %}
|
{% extends "newbase.html" %}
|
||||||
{% block title %}Contact Us{% endblock title %}
|
{% block title %}Contact Us{% endblock title %}
|
||||||
{% block main %}
|
{% block main %}
|
||||||
<h1>Contact us through email</h1>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="main-content">
|
<ul class="main-content">
|
||||||
<li class="grid_2">
|
<li class="grid_2">
|
||||||
|
<h1>Contact us through email</h1>
|
||||||
{% if form.errors %}
|
{% if form.errors %}
|
||||||
<p style="color: red;">
|
<p style="color: red;">
|
||||||
Please correct the error{{ form.errors|pluralize }} below.
|
Please correct the error{{ form.errors|pluralize }} below.
|
||||||
|
|||||||
@@ -1300,6 +1300,10 @@ def sendmail(request):
|
|||||||
messages.error(
|
messages.error(
|
||||||
request, "Something went wrong trying to send the form")
|
request, "Something went wrong trying to send the form")
|
||||||
return HttpResponseRedirect('/rowers/email/thankyou/')
|
return HttpResponseRedirect('/rowers/email/thankyou/')
|
||||||
|
else:
|
||||||
|
if "captcha" in form.errors:
|
||||||
|
messages.error(request,"Bots are not welcome")
|
||||||
|
return HttpResponseRedirect(reverse("sendmail"))
|
||||||
|
|
||||||
|
|
||||||
return render(request,'email.html',
|
return render(request,'email.html',
|
||||||
|
|||||||
Reference in New Issue
Block a user