labd / django-cognito-jwt

An Authentication backend for Django Rest Framework for AWS Cognito JWT tokens
MIT License
179 stars 59 forks source link

atomic transaction for creating new user #1

Closed mikedebock closed 6 years ago

mikedebock commented 6 years ago

Atomic transaction for creating new user, when firing multiple requests at same time.

mvantellingen commented 6 years ago

BTW; using a transaction can still result in an error when concurrent requests are done. This should be handled with a try/except clause (select user, insert if no user, if insert fails due to duplicate, retrieve user)

mikedebock commented 6 years ago

This pr is unnecessary, fixed in get_or_create_for_cognito method.