You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a redundant import in djoser.urls.base that can be safely removed.
Description
In base.py (djoser.urls.base), the User model is imported but never used:
fromdjango.contrib.authimportget_user_modelfromrest_framework.routersimportDefaultRouterfromdjoserimportviewsrouter=DefaultRouter()
router.register("users", views.UserViewSet)
User=get_user_model() # This import is unusedurlpatterns=router.urls
Since User is not accessed anywhere in the file, it can be removed without affecting functionality.
Proposed Change
I removed the User import, resulting in the following simplified code:
After making this change, I ran the test suite. All tests passed except for test_constants_translations_are_up_to_date, which is unrelated to this change.
Expected Impact
This cleanup does not alter functionality but improves code clarity and eliminates unnecessary imports.
Let me know if any additional information is needed!
The text was updated successfully, but these errors were encountered:
Summary
There is a redundant import in
djoser.urls.base
that can be safely removed.Description
In
base.py
(djoser.urls.base
), theUser
model is imported but never used:Since
User
is not accessed anywhere in the file, it can be removed without affecting functionality.Proposed Change
I removed the
User
import, resulting in the following simplified code:Testing
After making this change, I ran the test suite. All tests passed except for
test_constants_translations_are_up_to_date
, which is unrelated to this change.Expected Impact
This cleanup does not alter functionality but improves code clarity and eliminates unnecessary imports.
Let me know if any additional information is needed!
The text was updated successfully, but these errors were encountered: