Private
Public Access
1
0
This commit is contained in:
2025-10-30 15:38:40 +01:00
parent 12eb7cb978
commit 4ce06f75a9
5 changed files with 43 additions and 9 deletions

View File

@@ -1066,7 +1066,8 @@ class RegistrationFormSex(RegistrationFormUniqueEmail):
month=4,
day=15))
url = HoneypotField(label="URL")
hp_field = HoneypotField(label="URL")
timestamp = forms.CharField(widget=forms.HiddenInput(), required=False)
def clean_birthdate(self):
dob = self.cleaned_data['birthdate']
@@ -1087,6 +1088,22 @@ class RegistrationFormSex(RegistrationFormUniqueEmail):
adaptiveclass = forms.ChoiceField(label='Adaptive Classification',
choices=adaptivecategories, initial='None', required=False)
captcha = ReCaptchaField(widget=ReCaptchaV3(
attrs={
'required_score': 0.85,
}))
def clean(self):
cleaned_data = super().clean()
timestamp = cleaned_data.get('timestamp')
if timestamp:
submission_time = timezone.now()
form_render_time = timezone.datetime.fromtimestamp(float(timestamp), tz=timezone.get_current_timezone())
if (submission_time - form_render_time).seconds < 3:
raise forms.ValidationError("Form submitted too quickly. Are you a bot?")
return cleaned_data
class PowerIntervalUpdateForm(forms.Form):
selectorchoices = (