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

Fix import error cannot import name ugettext lazy from django.utils.translation #7

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
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
14 changes: 7 additions & 7 deletions debug_toolbar_user_switcher/panels.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
from django import VERSION
from django.conf import settings
from django.http import HttpResponseForbidden
from django.conf.urls import url
from django.urls import path
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from django.contrib.auth import get_user_model

Expand Down Expand Up @@ -98,7 +98,7 @@ def content(self):
"user": self.request.user,
"form": UserForm(),
"next": self.request.GET.get("next"),
"users": get_user_model().objects.order_by("-last_login")[:10],
"users": get_user_model().objects.order_by("-last_login")[:20],
"current": current,
},
)
Expand All @@ -113,11 +113,11 @@ def process_request(self, request):
@classmethod
def get_urls(cls):
return (
url(r"^users/login/$", views.login_form, name="debug-userpanel-login-form"),
url(
r"^users/login/(?P<pk>-?\d+)$",
path("users/login/", views.login_form, name="debug-userpanel-login-form"),
path(
"users/login/<uuid:pk>",
views.login,
name="debug-userpanel-login",
),
url(r"^users/logout$", views.logout, name="debug-userpanel-logout"),
path("users/logout", views.logout, name="debug-userpanel-logout"),
)