Skip to content

Commit 79195d9

Browse files
committed
update apps
1 parent 99554ef commit 79195d9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

users/forms.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
2+
from django.contrib.auth.models import User
3+
from django import forms
4+
5+
6+
7+
8+
9+
class UserRegisterForm(UserCreationForm):
10+
class Meta:
11+
model = User
12+
fields = ('username', 'first_name', 'last_name', 'email')
13+
14+
class UserUpdateForm(UserChangeForm):
15+
password = None # не показываем поле пароля для редактирования
16+
17+
class Meta:
18+
model = User
19+
fields = ('username', 'first_name', 'last_name', 'email')
20+
21+
22+
23+

0 commit comments

Comments
 (0)