Skip to content

Commit

Permalink
update user create form base class to djangoallauths SignupForm class…
Browse files Browse the repository at this point in the history
… and add social login form class #1895
  • Loading branch information
jh-RLI committed Nov 20, 2024
1 parent e77a965 commit 4d1b155
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions login/forms.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
from allauth.account.forms import SignupForm
from allauth.socialaccount.forms import SignupForm as SocialSignupForm
from captcha.fields import CaptchaField
from django import forms
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.contrib.auth.forms import (
PasswordChangeForm,
SetPasswordForm,
UserChangeForm,
UserCreationForm,
)
from django.core.exceptions import ValidationError

from .models import UserGroup
from .models import myuser as OepUser


class CreateUserForm(UserCreationForm):
class UserSocialSignupForm(SocialSignupForm):
"""
Renders the form when user has signed up using social accounts.
Default fields will be added automatically.
See UserSignupForm otherwise.
"""


class CreateUserForm(SignupForm):
captcha = CaptchaField()

class Meta:
Expand Down

0 comments on commit 4d1b155

Please sign in to comment.