Skip to content

Use get_by_natural_key() instead of get()#85

Open
jianyuan wants to merge 2 commits intofangli:masterfrom
yoyowallet:master
Open

Use get_by_natural_key() instead of get()#85
jianyuan wants to merge 2 commits intofangli:masterfrom
yoyowallet:master

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.

2 participants