From 307d78e42ee666436d9341ba64f509dd6f8262e0 Mon Sep 17 00:00:00 2001 From: Viicos <65306057+Viicos@users.noreply.github.com> Date: Wed, 14 Feb 2024 11:51:46 +0100 Subject: [PATCH] Remove `django-hijack` and `django-sniplates` --- requirements/base.in | 2 -- requirements/base.txt | 6 ------ requirements/ci.txt | 6 ------ requirements/dev.txt | 6 ------ src/objecttypes/conf/base.py | 14 -------------- src/objecttypes/urls.py | 1 - 6 files changed, 35 deletions(-) diff --git a/requirements/base.in b/requirements/base.in index 57be6ad6..df9c8322 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -10,11 +10,9 @@ jsonschema django django-admin-index django-axes -django-hijack django-jsonsuit django-redis django-rosetta -django-sniplates maykin-django-two-factor-auth maykin-django-two-factor-auth[phonenumbers] mozilla-django-oidc-db diff --git a/requirements/base.txt b/requirements/base.txt index 778cfd79..5ddbc790 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -67,7 +67,6 @@ django==3.2.20 # django-choices # django-filter # django-formtools - # django-hijack # django-jsonform # django-jsonsuit # django-otp @@ -78,7 +77,6 @@ django==3.2.20 # django-rest-framework-condition # django-rosetta # django-simple-certmanager - # django-sniplates # django-solo # djangorestframework # drf-nested-routers @@ -102,8 +100,6 @@ django-filter==23.2 # commonground-api-common django-formtools==2.4.1 # via maykin-django-two-factor-auth -django-hijack==3.3.0 - # via -r requirements/base.in django-ipware==6.0.3 # via django-axes django-jsonform==2.21.5 @@ -130,8 +126,6 @@ django-sendfile2==0.7.0 # via django-privates django-simple-certmanager==1.3.0 # via zgw-consumers -django-sniplates==0.7.1 - # via -r requirements/base.in django-solo==2.0.0 # via # commonground-api-common diff --git a/requirements/ci.txt b/requirements/ci.txt index 95606130..3b71d429 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -101,7 +101,6 @@ django==3.2.20 # django-choices # django-filter # django-formtools - # django-hijack # django-jenkins # django-jsonform # django-jsonsuit @@ -114,7 +113,6 @@ django==3.2.20 # django-rosetta # django-sendfile2 # django-simple-certmanager - # django-sniplates # django-solo # djangorestframework # drf-nested-routers @@ -142,8 +140,6 @@ django-formtools==2.4.1 # via # -r requirements/base.txt # maykin-django-two-factor-auth -django-hijack==3.3.0 - # via -r requirements/base.txt django-ipware==6.0.3 # via # -r requirements/base.txt @@ -192,8 +188,6 @@ django-simple-certmanager==1.3.0 # via # -r requirements/base.txt # zgw-consumers -django-sniplates==0.7.1 - # via -r requirements/base.txt django-solo==2.0.0 # via # -r requirements/base.txt diff --git a/requirements/dev.txt b/requirements/dev.txt index 84059270..f2fd361f 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -121,7 +121,6 @@ django==3.2.20 # django-extensions # django-filter # django-formtools - # django-hijack # django-jenkins # django-jsonform # django-jsonsuit @@ -134,7 +133,6 @@ django==3.2.20 # django-rosetta # django-sendfile2 # django-simple-certmanager - # django-sniplates # django-solo # djangorestframework # drf-nested-routers @@ -166,8 +164,6 @@ django-formtools==2.4.1 # via # -r requirements/ci.txt # maykin-django-two-factor-auth -django-hijack==3.3.0 - # via -r requirements/ci.txt django-ipware==6.0.3 # via # -r requirements/ci.txt @@ -216,8 +212,6 @@ django-simple-certmanager==1.3.0 # via # -r requirements/ci.txt # zgw-consumers -django-sniplates==0.7.1 - # via -r requirements/ci.txt django-solo==2.0.0 # via # -r requirements/ci.txt diff --git a/src/objecttypes/conf/base.py b/src/objecttypes/conf/base.py index b34409c2..3a4443c3 100644 --- a/src/objecttypes/conf/base.py +++ b/src/objecttypes/conf/base.py @@ -1,6 +1,5 @@ import os -# Django-hijack (and Django-hijack-admin) from django.urls import reverse_lazy from sentry_sdk.integrations import django, redis @@ -69,9 +68,6 @@ # External applications. "axes", "jsonsuit.apps.JSONSuitConfig", - "sniplates", - "hijack", - "hijack.contrib.admin", "mozilla_django_oidc", "mozilla_django_oidc_db", "django_jsonform", @@ -104,7 +100,6 @@ "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", "axes.middleware.AxesMiddleware", - "hijack.middleware.HijackUserMiddleware", "django_otp.middleware.OTPMiddleware", ] @@ -359,15 +354,6 @@ "REMOTE_ADDR", ) -# Django-Hijack -HIJACK_LOGIN_REDIRECT_URL = "/" -HIJACK_LOGOUT_REDIRECT_URL = reverse_lazy("admin:accounts_user_changelist") -# The Admin mixin is used because we use a custom User-model. -HIJACK_REGISTER_ADMIN = False -# This is a CSRF-security risk. -# See: http://django-hijack.readthedocs.io/en/latest/configuration/#allowing-get-method-for-hijack-views -HIJACK_ALLOW_GET_REQUESTS = True - # Sentry SDK SENTRY_DSN = config("SENTRY_DSN", None) diff --git a/src/objecttypes/urls.py b/src/objecttypes/urls.py index c26a583c..b02f064d 100644 --- a/src/objecttypes/urls.py +++ b/src/objecttypes/urls.py @@ -25,7 +25,6 @@ auth_views.PasswordResetDoneView.as_view(), name="password_reset_done", ), - path("admin/hijack/", include("hijack.urls")), path("admin/", admin.site.urls), path( "reset///",