Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
feat(registerView): add register view
Browse files Browse the repository at this point in the history
  • Loading branch information
HladczukLe committed Oct 31, 2023
1 parent 5afac5e commit c57f0c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion apps/users/forms.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
from typing import TYPE_CHECKING

from django.contrib.auth.forms import UserCreationForm

from apps.users.models import User

if TYPE_CHECKING:
BaseUserCreationForm = UserCreationForm[User]
else:
BaseUserCreationForm = UserCreationForm


class CreateUserForm(UserCreationForm[User]):
class CreateUserForm(BaseUserCreationForm):
class Meta:
model = User
fields = ["username", "email", "password1", "password2"]
2 changes: 1 addition & 1 deletion apps/users/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
app_name = "users"

urlpatterns = [
path("register/", RegisterView.as_view(), name="register"),
path("", RegisterView.as_view(), name="register"),
]

0 comments on commit c57f0c1

Please sign in to comment.