-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
AuthTokenManager.get_or_create calls wrong create #18
Comments
Hi, @hodunov. It makes me glad that you found this library useful. So I can better address this issue, can you let me know the python and django versions your project is using ? |
If you see the code inside On digging more into this, I find that this was fixed in Django v1.8a1 as mentioned in this StackOverflow thread, quoted below,
|
Yes, of course, no problem. Absolutely right, rushed and did not describe my thoughts on this matter. I agree that the reason is exactly in |
I have an interesting situation too -- AuthToken.objects.get_or_create works in most cases, but when I'm performing Django unit tests, AuthToken.objects.get_or_create within the API views I'm testing doesn't work (but they do work in the unit tests themselves, before I call the API views!). |
Hi!
Thanks for the library, it really helped me solve my problem. But while implementing authorization via GraphQL I encountered the following problem:
AuthToken.objects.get_or_create(user=user, client=auth_client)
method does not work correctly.Expected behavior: classic
get_or_create
Real result: error
NOT NULL constraint failed: durin_authtoken.expiry
A piece of code in which an error occurs:
If I wrap it in try-exept, everything works as it should.
The text was updated successfully, but these errors were encountered: