Skip to content
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

"name 'IntegrityError' is not defined" #222

Open
sarwarmdgolam opened this issue May 11, 2024 · 1 comment
Open

"name 'IntegrityError' is not defined" #222

sarwarmdgolam opened this issue May 11, 2024 · 1 comment

Comments

@sarwarmdgolam
Copy link

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
Copy link

bojanKuzma commented May 31, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants