wagnerdelima / drf-social-oauth2

drf-social-oauth2 makes it easy to integrate Django social authentication with major OAuth2 providers, i.e., Facebook, Twitter, Google, etc.
https://drf-social-oauth2.readthedocs.io/en/latest/
MIT License
272 stars 34 forks source link

"name 'IntegrityError' is not defined" #222

Closed sarwarmdgolam closed 3 months ago

sarwarmdgolam commented 4 months ago

Describe the bug Exception type 'IntegrityError' is not found

To Reproduce Steps to reproduce the behavior:

  1. POST http://localhost:8022/auth/convert-token
  2. Response shows 500Errors { "detail": [ "name 'IntegrityError' is not defined" ] }

Expected behavior 'IntegrityError' list need to import properly.

bojanKuzma commented 4 months ago

I made a PR for this error, it's because some imports of exceptions are missing and the error messages indicates that they are missing, until approval you can just import the missing constant and class with:

from django.db import IntegrityError
from rest_framework.status import HTTP_500_INTERNAL_SERVER_ERROR