django-saml2-auth icon indicating copy to clipboard operation
django-saml2-auth copied to clipboard

Use get_by_natural_key() instead of get()

Open jianyuan opened this issue 5 years ago • 2 comments

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

jianyuan avatar Feb 08 '19 15:02 jianyuan

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.

fangli avatar Mar 08 '19 09:03 fangli

@fangli Done!

jianyuan avatar Mar 14 '19 22:03 jianyuan