Добавил капчу на форму регистрации
This commit is contained in:
parent
f22849878b
commit
443d547f9d
@ -78,6 +78,7 @@ class ProfileForm(forms.ModelForm):
|
||||
|
||||
|
||||
class RegistrationForm(UserCreationForm):
|
||||
captcha = TurnstileField(label='', theme='light', size='normal')
|
||||
# Поля пользователя
|
||||
first_name = forms.CharField(
|
||||
max_length=30,
|
||||
|
||||
@ -30,6 +30,8 @@
|
||||
{% bootstrap_field form.specialization %}
|
||||
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%;">Зарегистрироваться</button>
|
||||
<!-- {{ form.as_p }} -->
|
||||
{{ form.captcha }}
|
||||
</form>
|
||||
<hr>
|
||||
<p class="text-center">
|
||||
|
||||
@ -229,6 +229,10 @@ class RegisterView(PageViewTrackingMixin, MenuContextMixin, SuccessMessageMixin,
|
||||
|
||||
return context
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.request = kwargs.pop('request', None)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
|
||||
class ProfileEditView(LoginRequiredMixin, PageViewTrackingMixin, MenuContextMixin, BreadcrumbMixin, UpdateView):
|
||||
model = Profile
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user