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

Use get_by_natural_key() instead of get() #85

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jianyuan
Copy link

@jianyuan jianyuan commented Feb 8, 2019

We use email instead of username as our natural key. The library should get the user using the value nominated by User.USERNAME_FIELD.

@fangli
Copy link
Owner

fangli commented Mar 8, 2019

Good catch!
Since this method has backward compatibility issues for old django version, could you get a chance to add try-catch for this method?
So we try get_by_natural_key first, then fallback to get when specific exception happens.

@jianyuan
Copy link
Author

@fangli Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants