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

Remove login_required decorator #315

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove login_required decorator
The login_required decorator was used before we switched to DRF to redirect to login page
if there were no user authenticated. Since we were using session authentication up until
recently, the decorator had no impact on the proper functioning of the view, even though
it overlapped with the permission_classes.
It broke when we switched to token-based authentication, since it checks for session objects,
which are no longer used.
  • Loading branch information
nas-tabchiche committed Apr 23, 2024
commit 00cad7c20e0804e807a363fbe9e292459458324f
5 changes: 2 additions & 3 deletions backend/serdes/urls.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from django.urls import path
from django.contrib.auth.decorators import login_required

from . import views

urlpatterns = [
path("dump-db/", login_required(views.dump_db_view), name="dump-db"),
path("dump-db/", views.dump_db_view, name="dump-db"),
path(
"load-backup/",
login_required(views.LoadBackupView.as_view()),
views.LoadBackupView.as_view(),
name="load-backup",
),
]
Loading