Skip to content

Use get_by_natural_key() instead of get()#85

Open
jianyuan wants to merge 2 commits into
fangli:masterfrom
yoyowallet:master
Open

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

Conversation

@jianyuan

@jianyuan jianyuan commented Feb 8, 2019

Copy link
Copy Markdown

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

fangli commented Mar 8, 2019

Copy link
Copy Markdown
Owner

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
Copy Markdown
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