We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Thank you for the project!
def jwt_payload(user, context=None): username = user.get_username() if hasattr(username, 'pk'): username = username.pk payload = { user.USERNAME_FIELD: username, 'exp': datetime.utcnow() + jwt_settings.JWT_EXPIRATION_DELTA, }
It's the code snippet of the package to get jwt_payload. My understanding was get_username() will always return string as its value.
Code snippet from AbstractBaseUser class.
AbstractBaseUser
My question is why do we need to check the username hasattr pk? Will it return an object for some cases?
hasattr
pk
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Thank you for the project!
It's the code snippet of the package to get jwt_payload. My understanding was get_username() will always return string as its value.
Code snippet from
AbstractBaseUser
class.My question is why do we need to check the username
hasattr
pk
? Will it return an object for some cases?The text was updated successfully, but these errors were encountered: