auth.py 644 B

123456789101112131415161718192021
  1. from django import forms
  2. from django.contrib.auth.forms import UserCreationForm, AuthenticationForm, UsernameField
  3. from django.contrib.auth import get_user_model
  4. from sharix_admin.forms import BaseForm
  5. class ShariXSignUpForm(BaseForm, UserCreationForm):
  6. """
  7. Форма для регистрации пользователей.
  8. """
  9. class Meta:
  10. model = get_user_model()
  11. fields = ('last_name', 'first_name', 'middle_name', 'phone_number', 'email', 'username')
  12. class ShariXLoginForm(BaseForm, AuthenticationForm):
  13. """
  14. Форма для авторизации пользователей.
  15. """
  16. pass