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