Skip to content

Commit

Permalink
Restore ability to access impersonation routes at /admin/impersonate/…
Browse files Browse the repository at this point in the history
….../ (#1110)

Co-authored-by: Jake Rosenberg <[email protected]>
  • Loading branch information
jarosenb and Jake Rosenberg authored Oct 24, 2023
1 parent 0ce1c66 commit 37d39b8
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions designsafe/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import RedirectView, TemplateView
from django.urls import reverse
from django.urls import reverse, path
from django.http import HttpResponse, HttpResponseRedirect
from designsafe.apps.auth.views import login_options as des_login_options
from django.contrib.auth.views import LogoutView as des_logout
from designsafe.views import project_version as des_version, redirect_old_nees
from impersonate import views as impersonate_views

# sitemap - classes must be imported and added to sitemap dictionary
from django.contrib.sitemaps.views import sitemap
Expand All @@ -49,8 +50,29 @@

urlpatterns = [
# admin
url(r'^admin/impersonation/', include('impersonate.urls')),
url(r'^admin/', admin.site.urls),
path(
"admin/impersonate/stop/",
impersonate_views.stop_impersonate,
name="impersonate-stop",
),
path(
"admin/impersonate/list/",
impersonate_views.list_users,
{"template": "impersonate/list_users.html"},
name="impersonate-list",
),
path(
"admin/impersonate/search/",
impersonate_views.search_users,
{"template": "impersonate/search_users.html"},
name="impersonate-search",
),
path(
"admin/impersonate/<int:uid>/",
impersonate_views.impersonate,
name="impersonate-start",
),
path("admin/", admin.site.urls),

# sitemap
url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap'),
Expand Down

0 comments on commit 37d39b8

Please sign in to comment.