Skip to content
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

remove get_by_natural_key implementation on UserProfileManager #2364

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion evap/development/fixtures/test_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -152737,7 +152737,7 @@
"is_superuser": false,
"password": "pbkdf2_sha256$12000$lRV0h1V7qLSK$pKzYyUhT7l65JxoIv7Du3btUHYzfGCZ81JFtbF9ymOY=",
"last_login": "2014-03-24T10:25:43.302",
"email": "[email protected]",
"email": null,
"title": "",
"first_name_given": "Dot",
"first_name_chosen": "",
Expand Down
4 changes: 3 additions & 1 deletion evap/evaluation/models.py
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do want to note here that get_by_natural_keys is required by django.contrib.auth.handers.modwsgi, but we don't use it.

Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,9 @@ def is_empty(self):
return not (self.title or self.content)


class UserProfileManager(BaseUserManager):
class UserProfileManager(models.Manager["UserProfile"]):
normalize_email = BaseUserManager.normalize_email

def create_user(self, *, email, password=None, first_name_given=None, last_name=None):
user = self.model(email=self.normalize_email(email), first_name_given=first_name_given, last_name=last_name)
validate_password(password, user=user)
Expand Down
Loading