From 208dd0755cfb35fc20c2cbaf8624c3468d408fba Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 11 Feb 2020 11:06:38 +0100 Subject: [PATCH 1/3] misc: clean dead imports (#39745) --- src/authentic2/manager/user_views.py | 4 ++-- src/authentic2/utils/__init__.py | 9 ++++----- src/authentic2/views.py | 3 +-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/authentic2/manager/user_views.py b/src/authentic2/manager/user_views.py index 5faebe90..a9815dc7 100644 --- a/src/authentic2/manager/user_views.py +++ b/src/authentic2/manager/user_views.py @@ -29,13 +29,13 @@ from django.core.urlresolvers import reverse from django.contrib.auth import get_user_model, REDIRECT_FIELD_NAME from django.contrib.contenttypes.models import ContentType from django.contrib import messages -from django.views.generic import FormView, TemplateView, RedirectView, DetailView +from django.views.generic import FormView, TemplateView, DetailView from django.http import Http404, FileResponse import tablib from authentic2.models import Attribute, AttributeValue, PasswordReset -from authentic2.utils import build_su_url, send_password_reset_mail, redirect, select_next_url, make_url +from authentic2.utils import send_password_reset_mail, redirect, select_next_url, make_url, switch_user from authentic2.a2_rbac.utils import get_default_ou from authentic2 import hooks from django_rbac.utils import get_role_model, get_role_parenting_model, get_ou_model diff --git a/src/authentic2/utils/__init__.py b/src/authentic2/utils/__init__.py index 79a473aa..39e0a913 100644 --- a/src/authentic2/utils/__init__.py +++ b/src/authentic2/utils/__init__.py @@ -31,10 +31,10 @@ from importlib import import_module from django.conf import settings from django.http import HttpResponseRedirect, HttpResponse -from django.core.exceptions import ImproperlyConfigured, PermissionDenied +from django.core.exceptions import ImproperlyConfigured from django.http.request import QueryDict -from django.contrib.auth import (REDIRECT_FIELD_NAME, login as auth_login, SESSION_KEY, - HASH_SESSION_KEY, BACKEND_SESSION_KEY, authenticate as dj_authenticate, +from django.contrib.auth import (REDIRECT_FIELD_NAME, login as auth_login, + authenticate as dj_authenticate, get_user_model) from django import forms from django.forms.utils import ErrorList, to_current_timezone @@ -49,8 +49,7 @@ from django.core import signing from django.core.cache import cache from django.core.urlresolvers import reverse from django.utils.formats import localize -from django.contrib import messages -from django.utils.functional import empty, allow_lazy +from django.utils.functional import allow_lazy from django.utils.http import urlsafe_base64_encode from django.utils.encoding import iri_to_uri, force_bytes, uri_to_iri from django.shortcuts import render diff --git a/src/authentic2/views.py b/src/authentic2/views.py index 99a39d25..0de56980 100644 --- a/src/authentic2/views.py +++ b/src/authentic2/views.py @@ -48,8 +48,7 @@ from django.contrib.auth import get_user_model from django.http import Http404 from django.utils.http import urlsafe_base64_decode from django.views.generic.edit import CreateView -from django.forms import CharField, Form -from django.core.urlresolvers import reverse_lazy +from django.forms import CharField from django.http import HttpResponseBadRequest from django.template import loader -- 2.24.0