misc: remove some unused imports (#52457)
This commit is contained in:
parent
6c4aad3ab5
commit
8b506d4281
|
@ -2,8 +2,6 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
import authentic2.logger
|
||||
|
||||
if __name__ == "__main__":
|
||||
config_file = False
|
||||
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
|
|
|
@ -7,7 +7,6 @@ import re
|
|||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
from optparse import OptionParser
|
||||
from shutil import copyfile
|
||||
|
||||
### This file came from the https://github.com/flow123d/flow123d repo they were nice enough to spend time to write this.
|
||||
### It is copied here for other people to use on its own.
|
||||
|
|
|
@ -20,12 +20,10 @@ from django.utils.text import slugify
|
|||
from django.utils.translation import ugettext
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from django_rbac.models import ADMIN_OP
|
||||
from django_rbac.utils import get_ou_model, get_permission_model, get_role_model
|
||||
from django_rbac.utils import get_ou_model, get_role_model
|
||||
|
||||
from ..utils import get_fk_model
|
||||
from . import app_settings, utils
|
||||
from .models import MANAGE_MEMBERS_OP
|
||||
|
||||
|
||||
def update_ou_admin_roles(ou):
|
||||
|
|
|
@ -56,7 +56,7 @@ from rest_framework.viewsets import ModelViewSet, ViewSet
|
|||
from authentic2.compat.drf import action
|
||||
from django_rbac.utils import get_ou_model, get_role_model
|
||||
|
||||
from . import api_mixins, app_settings, attribute_kinds, decorators, hooks, utils
|
||||
from . import api_mixins, app_settings, decorators, hooks, utils
|
||||
from .a2_rbac.utils import get_default_ou
|
||||
from .custom_user.models import User
|
||||
from .journal_event_types import UserLogin, UserRegistration
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
from datetime import date, timedelta
|
||||
|
||||
from django.db.models import DateField, Max, Min
|
||||
from django.db.models import Max, Min
|
||||
|
||||
|
||||
def _json_value(value):
|
||||
|
|
|
@ -24,7 +24,6 @@ try:
|
|||
from ldap.dn import escape_dn_chars
|
||||
from ldap.filter import filter_format
|
||||
from ldap.ldapobject import ReconnectLDAPObject as NativeLDAPObject
|
||||
from pyasn1.codec.der import decoder
|
||||
|
||||
PYTHON_LDAP3 = [int(x) for x in ldap.__version__.split('.')] >= [3]
|
||||
LDAPObject = NativeLDAPObject
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import inspect
|
||||
from datetime import datetime
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import itertools
|
||||
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ from __future__ import unicode_literals
|
|||
import base64
|
||||
import datetime
|
||||
import os
|
||||
import random
|
||||
|
||||
from django.core.exceptions import MultipleObjectsReturned, ValidationError
|
||||
from django.core.mail import send_mail
|
||||
|
@ -38,7 +37,7 @@ from django.contrib.postgres.fields import JSONField
|
|||
|
||||
from authentic2 import app_settings, utils
|
||||
from authentic2.decorators import RequestCache, errorcollector
|
||||
from authentic2.models import Attribute, AttributeValue, Service, UserExternalId
|
||||
from authentic2.models import Attribute, AttributeValue, Service
|
||||
from authentic2.validators import email_validator
|
||||
from django_rbac.models import PermissionMixin
|
||||
from django_rbac.utils import get_role_parenting_model
|
||||
|
|
|
@ -15,10 +15,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.forms import BooleanField, CheckboxInput, Form
|
||||
from django.utils.html import mark_safe
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
|
||||
class HoneypotInput(CheckboxInput):
|
||||
|
|
|
@ -22,12 +22,11 @@ from django.contrib.auth import forms as auth_forms
|
|||
from django.core.exceptions import ValidationError
|
||||
from django.db.models import Q
|
||||
from django.forms import Form
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from .. import app_settings, hooks, models, utils
|
||||
from ..backends import get_user_queryset
|
||||
from .fields import CheckPasswordField, NewPasswordField, PasswordField, ValidatedEmailField
|
||||
from .fields import CheckPasswordField, NewPasswordField, PasswordField
|
||||
from .utils import NextUrlFormMixin
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from collections import OrderedDict
|
||||
|
||||
from django import forms
|
||||
from django.forms.models import modelform_factory as dj_modelform_factory
|
||||
|
|
|
@ -23,13 +23,11 @@ from django import forms
|
|||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db.models.query import Q
|
||||
from django.utils import six
|
||||
from django.utils.text import slugify
|
||||
from django.utils.translation import pgettext, ugettext
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from authentic2 import app_settings as a2_app_settings
|
||||
from authentic2.a2_rbac.utils import get_default_ou
|
||||
from authentic2.forms.fields import CheckPasswordField, NewPasswordField, ValidatedEmailField
|
||||
from authentic2.forms.profile import BaseUserForm
|
||||
|
|
|
@ -31,7 +31,6 @@ from django.conf import settings
|
|||
from django.core.files.storage import default_storage
|
||||
from django.db import connection
|
||||
from django.utils import six
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.timezone import utc
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
|
|
@ -26,7 +26,7 @@ from django.contrib.contenttypes.models import ContentType
|
|||
from django.core.exceptions import PermissionDenied
|
||||
from django.core.mail import EmailMultiAlternatives
|
||||
from django.db import models, transaction
|
||||
from django.http import FileResponse, Http404, HttpResponseRedirect
|
||||
from django.http import FileResponse, Http404
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.template import loader
|
||||
from django.urls import reverse, reverse_lazy
|
||||
|
|
|
@ -24,9 +24,8 @@ from django.utils import six
|
|||
from django.utils.encoding import force_text
|
||||
from django_select2.forms import ModelSelect2MultipleWidget, ModelSelect2Widget
|
||||
|
||||
from authentic2.models import Service
|
||||
from authentic2_idp_oidc.models import OIDCAuthorization
|
||||
from django_rbac.utils import get_ou_model, get_role_model
|
||||
from django_rbac.utils import get_role_model
|
||||
|
||||
from . import utils
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ from datetime import timedelta
|
|||
|
||||
from django.conf import settings
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.postgres.search import SearchVector
|
||||
from django.db import models
|
||||
from django.db.models.query import QuerySet
|
||||
from django.utils.timezone import now
|
||||
|
|
|
@ -27,7 +27,6 @@ from django.shortcuts import render
|
|||
from django.urls import reverse
|
||||
from django.utils import six
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
|
||||
from authentic2.compat_lasso import lasso
|
||||
from authentic2.decorators import RequestCache
|
||||
|
|
|
@ -30,7 +30,6 @@ from django.utils.encoding import force_str, force_text
|
|||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from authentic2.compat_lasso import lasso
|
||||
from authentic2.utils import normalize_attribute_values
|
||||
|
||||
try:
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
|
||||
from __future__ import print_function
|
||||
|
||||
import base64
|
||||
import binascii
|
||||
import collections
|
||||
import datetime
|
||||
import re
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import base64
|
||||
import binascii
|
||||
import os
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
|
||||
import copy
|
||||
import ctypes
|
||||
import datetime
|
||||
import inspect
|
||||
import logging
|
||||
import random
|
||||
import time
|
||||
|
@ -26,7 +24,6 @@ from functools import wraps
|
|||
from importlib import import_module
|
||||
from itertools import chain, count, islice
|
||||
|
||||
import django.apps
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.contrib.auth import REDIRECT_FIELD_NAME
|
||||
|
@ -34,7 +31,6 @@ from django.contrib.auth import authenticate as dj_authenticate
|
|||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth import login as auth_login
|
||||
from django.core import signing
|
||||
from django.core.cache import cache
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.core.mail import EmailMessage, send_mail
|
||||
from django.forms.utils import ErrorList, to_current_timezone
|
||||
|
@ -45,11 +41,9 @@ from django.template.context import make_context
|
|||
from django.template.loader import TemplateDoesNotExist, render_to_string, select_template
|
||||
from django.urls import reverse
|
||||
from django.utils import html, six, timezone
|
||||
from django.utils.encoding import force_bytes, iri_to_uri, uri_to_iri
|
||||
from django.utils.encoding import iri_to_uri, uri_to_iri
|
||||
from django.utils.formats import localize
|
||||
from django.utils.http import urlsafe_base64_encode
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.translation import ungettext
|
||||
|
||||
try:
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from django.contrib.postgres.lookups import Unaccent as PGUnaccent
|
||||
from django.db.models import Func
|
||||
from django.db.models.functions import Concat
|
||||
from django.db.models.functions import ConcatPair as DjConcatPair
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ from django.template import loader
|
|||
from django.template.loader import render_to_string
|
||||
from django.urls import reverse
|
||||
from django.utils import six, timezone
|
||||
from django.utils.http import urlsafe_base64_decode
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.views.decorators.cache import never_cache
|
||||
from django.views.decorators.csrf import csrf_exempt, ensure_csrf_cookie
|
||||
|
|
|
@ -22,7 +22,7 @@ from django.contrib.postgres.fields import JSONField
|
|||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from jwcrypto.jwk import JWK, InvalidJWKValue, JWKSet
|
||||
from jwcrypto.jwk import InvalidJWKValue, JWKSet
|
||||
|
||||
from django_rbac.utils import get_ou_model_name
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ from django.core.exceptions import ImproperlyConfigured, ValidationError
|
|||
from django.core.validators import URLValidator
|
||||
from django.db import models
|
||||
from django.utils import six
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
from django.utils.timezone import now
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import os
|
||||
|
||||
from django.conf import global_settings
|
||||
|
||||
MIDDLEWA_CLASSES = global_settings.MIDDLEWARE
|
||||
|
|
|
@ -2,7 +2,6 @@ import uuid
|
|||
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.utils import six
|
||||
|
||||
from . import constants
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ from django.core.management import call_command
|
|||
from authentic2.a2_rbac.models import MANAGE_MEMBERS_OP
|
||||
from authentic2.a2_rbac.models import OrganizationalUnit as OU
|
||||
from authentic2.a2_rbac.models import Permission, Role, RoleAttribute
|
||||
from authentic2.a2_rbac.utils import get_default_ou, get_view_user_perm
|
||||
from authentic2.a2_rbac.utils import get_default_ou
|
||||
from authentic2.custom_user.models import User
|
||||
from authentic2.models import Service
|
||||
from authentic2.utils import get_hex_uuid
|
||||
|
|
|
@ -30,9 +30,7 @@ from django.contrib.contenttypes.models import ContentType
|
|||
from django.core import mail
|
||||
from django.urls import reverse
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.http import urlencode
|
||||
from django.utils.text import slugify
|
||||
from django.utils.timezone import now
|
||||
from requests.models import Response
|
||||
from rest_framework import VERSION as drf_version
|
||||
|
||||
|
|
|
@ -14,14 +14,12 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import datetime
|
||||
import os
|
||||
import re
|
||||
|
||||
import lasso
|
||||
import pytest
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.utils.timezone import now
|
||||
from mellon.models import UserSAMLIdentifier
|
||||
|
||||
from authentic2.custom_user.models import DeletedUser
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import random
|
||||
import time
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
from datetime import date
|
||||
|
||||
import pytest
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
from authentic2.custom_user.models import DeletedUser, User
|
||||
from authentic2.models import Attribute
|
||||
|
|
|
@ -34,14 +34,14 @@ from django.utils.encoding import force_bytes, force_str, force_text
|
|||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
from authentic2.a2_rbac.models import OrganizationalUnit, Role, RoleAttribute
|
||||
from authentic2.a2_rbac.models import OrganizationalUnit, Role
|
||||
from authentic2.constants import NONCE_FIELD_NAME, SERVICE_FIELD_NAME
|
||||
from authentic2.custom_user.models import User
|
||||
from authentic2.idp.saml import saml2_endpoints
|
||||
from authentic2.idp.saml.saml2_endpoints import get_extensions, get_login_hints_extension
|
||||
from authentic2.models import Attribute, Service
|
||||
from authentic2.saml import models as saml_models
|
||||
from authentic2.saml.models import LibertyProvider, SAMLAttribute
|
||||
from authentic2.saml.models import SAMLAttribute
|
||||
from authentic2.utils import make_url
|
||||
|
||||
from . import utils
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import mock
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
from django.db.utils import ProgrammingError
|
||||
from django.utils.timezone import now
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ import datetime
|
|||
import pytest
|
||||
from django.core import management
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils.timezone import now
|
||||
|
||||
from authentic2.custom_user.models import DeletedUser, User
|
||||
from authentic2.models import Attribute, AttributeValue, UserExternalId
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import pytest
|
||||
|
||||
from authentic2.utils.lazy import lazy_join
|
||||
|
||||
|
|
Loading…
Reference in New Issue