From 901ce4de269ac5158fabc707afcbcf8be4a1b0f6 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Tue, 21 Sep 2021 12:08:47 +0200 Subject: [PATCH 49/59] misc: fix unused-import pylint error (#56982) --- ...03_partial_unique_index_on_name_and_slug.py | 2 +- .../migrations/0004_auto_20150523_0028.py | 2 +- .../migrations/0008_auto_20150810_1953.py | 2 +- .../0009_partial_unique_index_on_permission.py | 2 +- .../migrations/0011_auto_20160209_1511.py | 2 +- .../migrations/0013_auto_20170629_0007.py | 2 +- .../migrations/0014_auto_20170711_1024.py | 2 +- .../migrations/0016_auto_20171208_1429.py | 2 +- .../0020_partial_unique_index_on_name.py | 2 +- .../migrations/0001_initial.py | 1 - .../migrations/0004_auto_20150915_2041.py | 2 +- src/authentic2/attribute_kinds.py | 1 - src/authentic2/compat/drf.py | 2 +- src/authentic2/compat/misc.py | 18 ------------------ src/authentic2/compat_lasso.py | 2 +- .../migrations/0003_auto_20150504_1410.py | 2 +- .../migrations/0009_auto_20150810_1953.py | 2 +- .../migrations/0015_auto_20170707_1653.py | 2 +- src/authentic2/decorators.py | 5 ++--- .../idp/migrations/0003_auto_20150915_2041.py | 2 +- .../management/commands/sync-ldap-users.py | 4 ++-- src/authentic2/manager/journal_views.py | 2 +- src/authentic2/manager/user_export.py | 1 - src/authentic2/manager/user_views.py | 7 ++----- .../migrations/0009_auto_20160211_2247.py | 2 +- .../migrations/0011_auto_20160211_2253.py | 2 +- .../migrations/0013_auto_20160211_2258.py | 2 +- .../migrations/0020_delete_federatedid.py | 2 +- src/authentic2/models.py | 2 +- src/authentic2/saml/migrations/0003_merge.py | 2 +- .../migrations/0006_restore_foreign_keys.py | 2 +- .../saml/migrations/0014_auto_20150617_1216.py | 2 +- .../saml/migrations/0016_auto_20150915_2041.py | 2 +- src/authentic2/serializers.py | 1 - src/authentic2/validators.py | 2 +- src/authentic2/wsgi.py | 2 +- src/authentic2_auth_fc/apps.py | 2 -- src/authentic2_auth_fc/backends.py | 1 - .../migrations/0001_initial.py | 1 - .../migrations/0008_auto_20201102_1142.py | 1 - .../migrations/0004_create_services.py | 2 +- .../migrations/0006_copy_proxy_m2m.py | 2 +- .../migrations/0008_alter_foreign_keys.py | 2 +- .../0010_copy_service_ptr_id_to_old_id.py | 2 +- .../0012_copy_service_proxy_to_m2m.py | 2 +- .../0013_delete_model_service_proxy2.py | 2 +- src/django_rbac/migrations/0001_initial.py | 1 - tests/test_auth_oidc.py | 1 - tests/test_commands.py | 2 +- tests/test_ldap.py | 2 -- tests/test_login.py | 2 +- tests/utils.py | 1 - 52 files changed, 42 insertions(+), 78 deletions(-) diff --git a/src/authentic2/a2_rbac/migrations/0003_partial_unique_index_on_name_and_slug.py b/src/authentic2/a2_rbac/migrations/0003_partial_unique_index_on_name_and_slug.py index 18c6a4d3..d3da5b23 100644 --- a/src/authentic2/a2_rbac/migrations/0003_partial_unique_index_on_name_and_slug.py +++ b/src/authentic2/a2_rbac/migrations/0003_partial_unique_index_on_name_and_slug.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations from authentic2.migrations import CreatePartialIndexes diff --git a/src/authentic2/a2_rbac/migrations/0004_auto_20150523_0028.py b/src/authentic2/a2_rbac/migrations/0004_auto_20150523_0028.py index c24cfe2c..da98ed99 100644 --- a/src/authentic2/a2_rbac/migrations/0004_auto_20150523_0028.py +++ b/src/authentic2/a2_rbac/migrations/0004_auto_20150523_0028.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/a2_rbac/migrations/0008_auto_20150810_1953.py b/src/authentic2/a2_rbac/migrations/0008_auto_20150810_1953.py index 252e1a18..6f63c2af 100644 --- a/src/authentic2/a2_rbac/migrations/0008_auto_20150810_1953.py +++ b/src/authentic2/a2_rbac/migrations/0008_auto_20150810_1953.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/a2_rbac/migrations/0009_partial_unique_index_on_permission.py b/src/authentic2/a2_rbac/migrations/0009_partial_unique_index_on_permission.py index a8bc2966..c88ffd1b 100644 --- a/src/authentic2/a2_rbac/migrations/0009_partial_unique_index_on_permission.py +++ b/src/authentic2/a2_rbac/migrations/0009_partial_unique_index_on_permission.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations from authentic2.migrations import CreatePartialIndexes diff --git a/src/authentic2/a2_rbac/migrations/0011_auto_20160209_1511.py b/src/authentic2/a2_rbac/migrations/0011_auto_20160209_1511.py index 77e16ac6..d36e53f7 100644 --- a/src/authentic2/a2_rbac/migrations/0011_auto_20160209_1511.py +++ b/src/authentic2/a2_rbac/migrations/0011_auto_20160209_1511.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/a2_rbac/migrations/0013_auto_20170629_0007.py b/src/authentic2/a2_rbac/migrations/0013_auto_20170629_0007.py index f9dcf139..602be82e 100644 --- a/src/authentic2/a2_rbac/migrations/0013_auto_20170629_0007.py +++ b/src/authentic2/a2_rbac/migrations/0013_auto_20170629_0007.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/a2_rbac/migrations/0014_auto_20170711_1024.py b/src/authentic2/a2_rbac/migrations/0014_auto_20170711_1024.py index 65af3344..5388d7c5 100644 --- a/src/authentic2/a2_rbac/migrations/0014_auto_20170711_1024.py +++ b/src/authentic2/a2_rbac/migrations/0014_auto_20170711_1024.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/a2_rbac/migrations/0016_auto_20171208_1429.py b/src/authentic2/a2_rbac/migrations/0016_auto_20171208_1429.py index a71f7915..43dca2c6 100644 --- a/src/authentic2/a2_rbac/migrations/0016_auto_20171208_1429.py +++ b/src/authentic2/a2_rbac/migrations/0016_auto_20171208_1429.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/a2_rbac/migrations/0020_partial_unique_index_on_name.py b/src/authentic2/a2_rbac/migrations/0020_partial_unique_index_on_name.py index 4e565c7c..589c7590 100644 --- a/src/authentic2/a2_rbac/migrations/0020_partial_unique_index_on_name.py +++ b/src/authentic2/a2_rbac/migrations/0020_partial_unique_index_on_name.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations from authentic2.migrations import CreatePartialIndexes diff --git a/src/authentic2/attribute_aggregator/migrations/0001_initial.py b/src/authentic2/attribute_aggregator/migrations/0001_initial.py index 79a1d7c0..d09fa8c4 100644 --- a/src/authentic2/attribute_aggregator/migrations/0001_initial.py +++ b/src/authentic2/attribute_aggregator/migrations/0001_initial.py @@ -1,4 +1,3 @@ -from django.conf import settings from django.db import migrations, models diff --git a/src/authentic2/attribute_aggregator/migrations/0004_auto_20150915_2041.py b/src/authentic2/attribute_aggregator/migrations/0004_auto_20150915_2041.py index 2e957bbe..4a8c94fc 100644 --- a/src/authentic2/attribute_aggregator/migrations/0004_auto_20150915_2041.py +++ b/src/authentic2/attribute_aggregator/migrations/0004_auto_20150915_2041.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/attribute_kinds.py b/src/authentic2/attribute_kinds.py index 87ea2a24..f0cee519 100644 --- a/src/authentic2/attribute_kinds.py +++ b/src/authentic2/attribute_kinds.py @@ -21,7 +21,6 @@ import hashlib import os import re import string -import urllib import uuid from itertools import chain diff --git a/src/authentic2/compat/drf.py b/src/authentic2/compat/drf.py index a0d507a6..2c28069e 100644 --- a/src/authentic2/compat/drf.py +++ b/src/authentic2/compat/drf.py @@ -16,7 +16,7 @@ try: - from rest_framework.decorators import action + from rest_framework.decorators import action # pylint: disable=unused-import except ImportError: from rest_framework.decorators import detail_route, list_route diff --git a/src/authentic2/compat/misc.py b/src/authentic2/compat/misc.py index ed10196d..20a68026 100644 --- a/src/authentic2/compat/misc.py +++ b/src/authentic2/compat/misc.py @@ -16,24 +16,6 @@ import inspect -from django.conf import settings - -try: - from django.contrib.auth import get_user_model -except ImportError: - from django.contrib.auth.models import User - - get_user_model = lambda: User - -try: - from django.db.transaction import atomic - - commit_on_success = atomic -except ImportError: - from django.db.transaction import commit_on_success - -user_model_label = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') - if hasattr(inspect, 'signature'): def signature_parameters(func): diff --git a/src/authentic2/compat_lasso.py b/src/authentic2/compat_lasso.py index af303787..574e16db 100644 --- a/src/authentic2/compat_lasso.py +++ b/src/authentic2/compat_lasso.py @@ -15,7 +15,7 @@ # along with this program. If not, see . try: - import lasso + import lasso # pylint: disable=unused-import except ImportError: class MockLasso: diff --git a/src/authentic2/custom_user/migrations/0003_auto_20150504_1410.py b/src/authentic2/custom_user/migrations/0003_auto_20150504_1410.py index 42f04d15..1ff07a19 100644 --- a/src/authentic2/custom_user/migrations/0003_auto_20150504_1410.py +++ b/src/authentic2/custom_user/migrations/0003_auto_20150504_1410.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/custom_user/migrations/0009_auto_20150810_1953.py b/src/authentic2/custom_user/migrations/0009_auto_20150810_1953.py index d616ae2c..addc8edd 100644 --- a/src/authentic2/custom_user/migrations/0009_auto_20150810_1953.py +++ b/src/authentic2/custom_user/migrations/0009_auto_20150810_1953.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/custom_user/migrations/0015_auto_20170707_1653.py b/src/authentic2/custom_user/migrations/0015_auto_20170707_1653.py index 72e9dfd2..e2eae54b 100644 --- a/src/authentic2/custom_user/migrations/0015_auto_20170707_1653.py +++ b/src/authentic2/custom_user/migrations/0015_auto_20170707_1653.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/decorators.py b/src/authentic2/decorators.py index bcedec9c..64b4a995 100644 --- a/src/authentic2/decorators.py +++ b/src/authentic2/decorators.py @@ -22,7 +22,6 @@ from contextlib import contextmanager from functools import wraps from json import dumps as json_dumps -from django.core.cache import cache as django_cache from django.core.exceptions import ValidationError from django.http import Http404, HttpResponse, HttpResponseBadRequest, HttpResponseForbidden from django.views.debug import technical_404_response @@ -30,7 +29,7 @@ from django.views.debug import technical_404_response from . import app_settings, middleware # XXX: import to_list for retrocompaibility -from .utils.misc import to_iter, to_list # noqa: F401 +from .utils.misc import to_iter, to_list # pylint: disable=unused-import class CacheUnusable(RuntimeError): @@ -65,7 +64,7 @@ def setting_enabled(name, settings=app_settings): def lasso_required(): def test(): try: - import lasso # noqa: F401 + import lasso # pylint: disable=unused-import return True except ImportError: diff --git a/src/authentic2/idp/migrations/0003_auto_20150915_2041.py b/src/authentic2/idp/migrations/0003_auto_20150915_2041.py index 9df582d0..c19710dc 100644 --- a/src/authentic2/idp/migrations/0003_auto_20150915_2041.py +++ b/src/authentic2/idp/migrations/0003_auto_20150915_2041.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/management/commands/sync-ldap-users.py b/src/authentic2/management/commands/sync-ldap-users.py index e7b97fd0..37ddc937 100644 --- a/src/authentic2/management/commands/sync-ldap-users.py +++ b/src/authentic2/management/commands/sync-ldap-users.py @@ -16,8 +16,8 @@ try: - import ldap - from ldap.filter import filter_format # noqa: F401 + import ldap # pylint: disable=unused-import + from ldap.filter import filter_format # pylint: disable=unused-import except ImportError: ldap = None diff --git a/src/authentic2/manager/journal_views.py b/src/authentic2/manager/journal_views.py index 940445bf..4fbf2603 100644 --- a/src/authentic2/manager/journal_views.py +++ b/src/authentic2/manager/journal_views.py @@ -20,7 +20,7 @@ import uuid from django import forms from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType -from django.core.exceptions import PermissionDenied, ValidationError +from django.core.exceptions import ValidationError from django.core.validators import EmailValidator from django.db.models import Q from django.urls import reverse diff --git a/src/authentic2/manager/user_export.py b/src/authentic2/manager/user_export.py index eb52bae2..23d206da 100644 --- a/src/authentic2/manager/user_export.py +++ b/src/authentic2/manager/user_export.py @@ -17,7 +17,6 @@ import collections import datetime import os -import pickle import uuid import tablib diff --git a/src/authentic2/manager/user_views.py b/src/authentic2/manager/user_views.py index 1fa7d56c..ab26fea9 100644 --- a/src/authentic2/manager/user_views.py +++ b/src/authentic2/manager/user_views.py @@ -17,14 +17,12 @@ import base64 import collections import operator -import pickle -import sys from django.contrib import messages from django.contrib.auth import REDIRECT_FIELD_NAME, get_user_model from django.core.exceptions import PermissionDenied from django.core.mail import EmailMultiAlternatives -from django.db import connection, models, transaction +from django.db import models, transaction from django.http import FileResponse, Http404, HttpResponse from django.shortcuts import get_object_or_404 from django.template import loader @@ -62,9 +60,8 @@ from .forms import ( UserSearchForm, ) from .journal_views import BaseJournalView -from .resources import UserResource from .tables import OuUserRolesTable, UserAuthorizationsTable, UserRolesTable, UserTable -from .user_export import UserExport, get_user_dataset +from .user_export import UserExport from .utils import get_ou_count, has_show_username from .views import ( Action, diff --git a/src/authentic2/migrations/0009_auto_20160211_2247.py b/src/authentic2/migrations/0009_auto_20160211_2247.py index 6055a60c..a1296d20 100644 --- a/src/authentic2/migrations/0009_auto_20160211_2247.py +++ b/src/authentic2/migrations/0009_auto_20160211_2247.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations def deduplicate_attribute_values(apps, schema_editor): diff --git a/src/authentic2/migrations/0011_auto_20160211_2253.py b/src/authentic2/migrations/0011_auto_20160211_2253.py index 23be6f09..cbc3a198 100644 --- a/src/authentic2/migrations/0011_auto_20160211_2253.py +++ b/src/authentic2/migrations/0011_auto_20160211_2253.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations def fill_attribute_value_multiple(apps, schema_editor): diff --git a/src/authentic2/migrations/0013_auto_20160211_2258.py b/src/authentic2/migrations/0013_auto_20160211_2258.py index b4af03db..5ed93532 100644 --- a/src/authentic2/migrations/0013_auto_20160211_2258.py +++ b/src/authentic2/migrations/0013_auto_20160211_2258.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations from authentic2.migrations import CreatePartialIndexes diff --git a/src/authentic2/migrations/0020_delete_federatedid.py b/src/authentic2/migrations/0020_delete_federatedid.py index 8d0fe8fd..cad07e97 100644 --- a/src/authentic2/migrations/0020_delete_federatedid.py +++ b/src/authentic2/migrations/0020_delete_federatedid.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/models.py b/src/authentic2/models.py index 8f9ec1ca..e9aefaf8 100644 --- a/src/authentic2/models.py +++ b/src/authentic2/models.py @@ -40,7 +40,7 @@ from django_rbac.utils import get_role_model_name # install our natural_key implementation from . import managers -from . import natural_key as unused_natural_key # noqa: F401 +from . import natural_key as unused_natural_key # pylint: disable=unused-import from .utils.misc import ServiceAccessDenied diff --git a/src/authentic2/saml/migrations/0003_merge.py b/src/authentic2/saml/migrations/0003_merge.py index 5cc6439a..4011dfdc 100644 --- a/src/authentic2/saml/migrations/0003_merge.py +++ b/src/authentic2/saml/migrations/0003_merge.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/saml/migrations/0006_restore_foreign_keys.py b/src/authentic2/saml/migrations/0006_restore_foreign_keys.py index d36c29e4..f9ef9104 100644 --- a/src/authentic2/saml/migrations/0006_restore_foreign_keys.py +++ b/src/authentic2/saml/migrations/0006_restore_foreign_keys.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations def create_services(apps, schema_editor): diff --git a/src/authentic2/saml/migrations/0014_auto_20150617_1216.py b/src/authentic2/saml/migrations/0014_auto_20150617_1216.py index 25dc17eb..87ccfd0e 100644 --- a/src/authentic2/saml/migrations/0014_auto_20150617_1216.py +++ b/src/authentic2/saml/migrations/0014_auto_20150617_1216.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/saml/migrations/0016_auto_20150915_2041.py b/src/authentic2/saml/migrations/0016_auto_20150915_2041.py index 9eaeb1cf..5aa6beb7 100644 --- a/src/authentic2/saml/migrations/0016_auto_20150915_2041.py +++ b/src/authentic2/saml/migrations/0016_auto_20150915_2041.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/authentic2/serializers.py b/src/authentic2/serializers.py index 9a4048ee..eddfb42f 100644 --- a/src/authentic2/serializers.py +++ b/src/authentic2/serializers.py @@ -15,7 +15,6 @@ # along with this program. If not, see . import json -import sys from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType diff --git a/src/authentic2/validators.py b/src/authentic2/validators.py index e3e9f4b1..1d400a69 100644 --- a/src/authentic2/validators.py +++ b/src/authentic2/validators.py @@ -29,7 +29,7 @@ from django.utils.translation import ugettext_lazy as _ from . import app_settings # keep those symbols here for retrocompatibility -from .passwords import password_help_text, validate_password # noqa: F401 +from .passwords import password_help_text, validate_password # pylint: disable=unused-import # copied from http://www.djangotips.com/real-email-validation diff --git a/src/authentic2/wsgi.py b/src/authentic2/wsgi.py index 19ac0172..9bc2ce8a 100644 --- a/src/authentic2/wsgi.py +++ b/src/authentic2/wsgi.py @@ -34,7 +34,7 @@ import os from django.core.wsgi import get_wsgi_application # XXX: monkeypatch logging -from . import logger # noqa: F401 +from . import logger # pylint: disable=unused-import os.environ.setdefault("DJANGO_SETTINGS_MODULE", "authentic2.settings") diff --git a/src/authentic2_auth_fc/apps.py b/src/authentic2_auth_fc/apps.py index 05dcad7b..059a92a8 100644 --- a/src/authentic2_auth_fc/apps.py +++ b/src/authentic2_auth_fc/apps.py @@ -17,8 +17,6 @@ import django.apps from django import template -from . import app_settings - class Plugin: def redirect_logout_list(self, request, **kwargs): diff --git a/src/authentic2_auth_fc/backends.py b/src/authentic2_auth_fc/backends.py index d5bc7406..337083cc 100644 --- a/src/authentic2_auth_fc/backends.py +++ b/src/authentic2_auth_fc/backends.py @@ -14,7 +14,6 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -import json import logging from django.contrib.auth import get_user_model diff --git a/src/authentic2_auth_oidc/migrations/0001_initial.py b/src/authentic2_auth_oidc/migrations/0001_initial.py index ecc88a3b..9609a8c4 100644 --- a/src/authentic2_auth_oidc/migrations/0001_initial.py +++ b/src/authentic2_auth_oidc/migrations/0001_initial.py @@ -4,7 +4,6 @@ import django.contrib.postgres.fields.jsonb from django.conf import settings from django.db import migrations, models -import authentic2.a2_rbac.utils import authentic2_auth_oidc.models diff --git a/src/authentic2_auth_oidc/migrations/0008_auto_20201102_1142.py b/src/authentic2_auth_oidc/migrations/0008_auto_20201102_1142.py index b66d57c0..3f59ef70 100644 --- a/src/authentic2_auth_oidc/migrations/0008_auto_20201102_1142.py +++ b/src/authentic2_auth_oidc/migrations/0008_auto_20201102_1142.py @@ -1,6 +1,5 @@ # Generated by Django 2.2.17 on 2020-11-02 10:42 -import django.db.models.deletion from django.conf import settings from django.db import migrations, models diff --git a/src/authentic2_idp_cas/migrations/0004_create_services.py b/src/authentic2_idp_cas/migrations/0004_create_services.py index a42aab0e..6eef196d 100644 --- a/src/authentic2_idp_cas/migrations/0004_create_services.py +++ b/src/authentic2_idp_cas/migrations/0004_create_services.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations def create_services(apps, schema_editor): diff --git a/src/authentic2_idp_cas/migrations/0006_copy_proxy_m2m.py b/src/authentic2_idp_cas/migrations/0006_copy_proxy_m2m.py index 0e62fdde..ef30e7d4 100644 --- a/src/authentic2_idp_cas/migrations/0006_copy_proxy_m2m.py +++ b/src/authentic2_idp_cas/migrations/0006_copy_proxy_m2m.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations def copy_proxy_m2m_to_service_proxy(apps, schema_editor): diff --git a/src/authentic2_idp_cas/migrations/0008_alter_foreign_keys.py b/src/authentic2_idp_cas/migrations/0008_alter_foreign_keys.py index fa4dee78..11fbaea5 100644 --- a/src/authentic2_idp_cas/migrations/0008_alter_foreign_keys.py +++ b/src/authentic2_idp_cas/migrations/0008_alter_foreign_keys.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations def alter_foreign_keys(apps, schema_editor): diff --git a/src/authentic2_idp_cas/migrations/0010_copy_service_ptr_id_to_old_id.py b/src/authentic2_idp_cas/migrations/0010_copy_service_ptr_id_to_old_id.py index 6c397e9d..cc6a7374 100644 --- a/src/authentic2_idp_cas/migrations/0010_copy_service_ptr_id_to_old_id.py +++ b/src/authentic2_idp_cas/migrations/0010_copy_service_ptr_id_to_old_id.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations def noop(apps, schema_editor): diff --git a/src/authentic2_idp_cas/migrations/0012_copy_service_proxy_to_m2m.py b/src/authentic2_idp_cas/migrations/0012_copy_service_proxy_to_m2m.py index b516f6aa..ace259af 100644 --- a/src/authentic2_idp_cas/migrations/0012_copy_service_proxy_to_m2m.py +++ b/src/authentic2_idp_cas/migrations/0012_copy_service_proxy_to_m2m.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations def copy_proxy_m2m_to_service_proxy(apps, schema_editor): diff --git a/src/authentic2_idp_cas/migrations/0013_delete_model_service_proxy2.py b/src/authentic2_idp_cas/migrations/0013_delete_model_service_proxy2.py index b0a5c06b..1640dd0c 100644 --- a/src/authentic2_idp_cas/migrations/0013_delete_model_service_proxy2.py +++ b/src/authentic2_idp_cas/migrations/0013_delete_model_service_proxy2.py @@ -1,4 +1,4 @@ -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/src/django_rbac/migrations/0001_initial.py b/src/django_rbac/migrations/0001_initial.py index 1fe5ec6e..eb31e5f2 100644 --- a/src/django_rbac/migrations/0001_initial.py +++ b/src/django_rbac/migrations/0001_initial.py @@ -1,4 +1,3 @@ -from django.conf import settings from django.db import migrations, models diff --git a/tests/test_auth_oidc.py b/tests/test_auth_oidc.py index 88271919..cb9429af 100644 --- a/tests/test_auth_oidc.py +++ b/tests/test_auth_oidc.py @@ -39,7 +39,6 @@ from authentic2.a2_rbac.utils import get_default_ou from authentic2.custom_user.models import DeletedUser from authentic2.models import Attribute, AttributeValue from authentic2.utils.misc import last_authentication_event -from authentic2_auth_oidc.backends import OIDCBackend from authentic2_auth_oidc.models import OIDCAccount, OIDCClaimMapping, OIDCProvider from authentic2_auth_oidc.utils import ( IDToken, diff --git a/tests/test_commands.py b/tests/test_commands.py index c33d5f13..a8f29d74 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -34,7 +34,7 @@ from authentic2_auth_oidc.models import OIDCAccount, OIDCProvider from django_rbac.models import ADMIN_OP, Operation from django_rbac.utils import get_operation, get_ou_model, get_permission_model, get_role_model -from .utils import call_command, login, run_on_commit_hooks +from .utils import call_command, login User = get_user_model() diff --git a/tests/test_ldap.py b/tests/test_ldap.py index e2f82055..2ace7971 100644 --- a/tests/test_ldap.py +++ b/tests/test_ldap.py @@ -733,8 +733,6 @@ def test_group_staff(slapd, settings, client, db): def test_get_users(slapd, settings, db, monkeypatch, caplog): - from types import MethodType - import django.db.models.base from django.contrib.auth.models import Group diff --git a/tests/test_login.py b/tests/test_login.py index 2c36a35b..eaa9c659 100644 --- a/tests/test_login.py +++ b/tests/test_login.py @@ -22,7 +22,7 @@ from django.contrib.auth import get_user_model from authentic2 import models from authentic2.utils.misc import get_token_login_url -from .utils import assert_event, check_log, login +from .utils import assert_event, login User = get_user_model() diff --git a/tests/utils.py b/tests/utils.py index 7d8f8f6d..0eebc2bf 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -21,7 +21,6 @@ import socket import urllib.parse from contextlib import closing, contextmanager -import httmock from django.core.management import call_command as django_call_command from django.shortcuts import resolve_url from django.test import TestCase -- 2.30.2