Issue #159 new

Duplicate Tokens

Ahmad Al-Ibrahim
created an issue

It is possible to have duplicate tokens if oauth_timestamp is the same and requests came in the same time.

I came across this problem when 3 requests to request a token came in the same time with the same timestamp, first 2 were saved, and the third got: MultipleObjectsReturned: get() returned more than one Token -- it returned 2!


Do we really need get_or_create call in TokenManager create_token method? I'm thinking replacing 'get_or_create' manager method with 'create' could solve the problem.

Comments (1)

  1. weissblitz

    Ahmad, were you able to you solve this issue? I'm using OAuth with Django and I'm also getting more than one OAuth Token record back.

    Thanks in advance!

  2. Log in to comment