Skip to content

Commit a458bc6

Browse files
committed
code cleanup
1 parent f636c40 commit a458bc6

File tree

6 files changed

+1
-9
lines changed

6 files changed

+1
-9
lines changed

djangosaml2/backends.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from django.core.exceptions import (ImproperlyConfigured,
2525
MultipleObjectsReturned)
2626

27-
from .signals import pre_user_save
2827

2928
logger = logging.getLogger('djangosaml2')
3029

djangosaml2/middleware.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import time
2-
from importlib import import_module
32

43
from django.conf import settings
54
from django.contrib.sessions.backends.base import UpdateError

djangosaml2/tests/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from django.contrib.auth import SESSION_KEY, get_user_model
2626
from django.contrib.auth.models import AnonymousUser
2727
from django.core.exceptions import ImproperlyConfigured
28-
from django.template import Context, Template
2928
from django.test import Client, TestCase, override_settings
3029
from django.test.client import RequestFactory
3130
from django.urls import reverse
@@ -39,8 +38,7 @@
3938
get_session_id_from_saml2,
4039
get_subject_id_from_saml2,
4140
saml2_from_httpredirect_request)
42-
from djangosaml2.views import (EchoAttributesView, _set_subject_id,
43-
finish_logout)
41+
from djangosaml2.views import (EchoAttributesView, finish_logout)
4442
from saml2.config import SPConfig
4543
from saml2.s_utils import decode_base64_and_inflate, deflate_and_base64_encode
4644

djangosaml2/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from django.conf import settings
2121
from django.core.exceptions import ImproperlyConfigured
2222
from django.utils.http import is_safe_url
23-
from django.utils.module_loading import import_string
2423
from saml2.config import SPConfig
2524
from saml2.s_utils import UnknownSystemEntity
2625

djangosaml2/views.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,6 @@ def post(self, request, attribute_mapping=None, create_unknown_user=None):
402402
def post_login_hook(self, request: HttpRequest, user: settings.AUTH_USER_MODEL, session_info: dict) -> None:
403403
""" If desired, a hook to add logic after a user has succesfully logged in.
404404
"""
405-
pass
406405

407406
def build_relay_state(self) -> str:
408407
""" The relay state is a URL used to redirect the user to the view where they came from.
@@ -418,7 +417,6 @@ def build_relay_state(self) -> str:
418417
def customize_session(self, user, session_info: dict):
419418
""" Subclasses can use this for customized functionality around user sessions.
420419
"""
421-
pass
422420

423421
def customize_relay_state(self, relay_state: str) -> str:
424422
""" Subclasses may override this method to implement custom logic for relay state.

tests/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
import os
1414

15-
import django
1615

1716
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1817
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

0 commit comments

Comments
 (0)