-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added users app and configured user registration and authorization by… #22
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
settings/base.py 53 строка, наверное просто забыл убрать
print(BASE_DIR)
Спасибо, что заметил. Заодно добавил аннотации типов в паре мест. |
return email | ||
|
||
|
||
class User(CreatedModifiedFields, AbstractUser): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для этой модели не нужно прописывать def __str__?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Этот метод присутствует в родительском классе.
def get_short_name(self) -> str: | ||
"""Метод получения сокращенного имени пользователя.""" | ||
|
||
return self.username |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не понимаю, для чего две функции возвращают одно и то же значение, если можно просто условиться использовать либо переписанный get_full_name, либо get_short_name. Или почему просто не использовать get_username?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В родительском классе присутствуют и без переопределения они бы пытались получить значение полей first_name и last_name, которые отключены в этой модели.
Создал приложение users и настроил регистрацию и авторизацию пользователя по email.