0001-misc-remove-six-module-usage-63688.patch
mellon/adapters.py | ||
---|---|---|
20 | 20 |
import threading |
21 | 21 |
import time |
22 | 22 |
import uuid |
23 |
from urllib.parse import urlparse |
|
23 | 24 |
from xml.etree import ElementTree as ET |
24 | 25 | |
25 | 26 |
import lasso |
... | ... | |
31 | 32 |
from django.contrib.auth.models import Group |
32 | 33 |
from django.core.exceptions import FieldDoesNotExist, PermissionDenied |
33 | 34 |
from django.core.files.storage import default_storage |
34 |
from django.utils import six |
|
35 | 35 |
from django.utils.encoding import force_text |
36 |
from django.utils.six.moves.urllib.parse import urlparse |
|
37 | 36 |
from django.utils.translation import ugettext as _ |
38 | 37 | |
39 | 38 |
from . import app_settings, models, models_utils, utils |
mellon/sessions_backends/db.py | ||
---|---|---|
27 | 27 | |
28 | 28 |
def get_expiry_age(self, **kwargs): |
29 | 29 |
session_not_on_or_after = self.get_session_not_on_or_after() |
30 |
expiry_age = super().get_expiry_age(**kwargs) |
|
30 | 31 |
if session_not_on_or_after and 'expiry' not in kwargs: |
31 |
kwargs['expiry'] = session_not_on_or_after |
|
32 |
return super().get_expiry_age(**kwargs) |
|
32 |
max_expiry_age = super().get_expiry_age(expiry=session_not_on_or_after) |
|
33 |
return min(expiry_age, max_expiry_age) |
|
34 |
return expiry_age |
|
33 | 35 | |
34 | 36 |
def get_expiry_date(self, **kwargs): |
35 | 37 |
session_not_on_or_after = self.get_session_not_on_or_after() |
38 |
expiry_date = super().get_expiry_date(**kwargs) |
|
36 | 39 |
if session_not_on_or_after and 'expiry' not in kwargs: |
37 |
kwargs['expiry'] = session_not_on_or_after |
|
38 |
return super().get_expiry_date(**kwargs) |
|
40 |
max_expiry_date = session_not_on_or_after |
|
41 |
return min(expiry_date, max_expiry_date) |
|
42 |
return expiry_date |
mellon/utils.py | ||
---|---|---|
18 | 18 |
import importlib |
19 | 19 |
import logging |
20 | 20 |
from functools import wraps |
21 |
from urllib.parse import urlparse |
|
21 | 22 |
from xml.parsers import expat |
22 | 23 | |
23 | 24 |
import isodate |
... | ... | |
27 | 28 |
from django.template.loader import render_to_string |
28 | 29 |
from django.urls import reverse |
29 | 30 |
from django.utils.encoding import force_text |
30 |
from django.utils.six.moves.urllib.parse import urlparse |
|
31 | 31 |
from django.utils.timezone import get_default_timezone, is_aware, make_aware, make_naive, now |
32 | 32 | |
33 | 33 |
from . import app_settings |
tests/test_sso_slo.py | ||
---|---|---|
17 | 17 |
import base64 |
18 | 18 |
import datetime |
19 | 19 |
import re |
20 |
import urllib.parse as urlparse |
|
20 | 21 |
import xml.etree.ElementTree as ET |
21 | 22 |
import zlib |
22 | 23 |
from html import unescape |
... | ... | |
26 | 27 |
from django.contrib.auth.models import User |
27 | 28 |
from django.contrib.sessions.models import Session |
28 | 29 |
from django.urls import reverse |
29 |
from django.utils import six |
|
30 | 30 |
from django.utils.encoding import force_str |
31 |
from django.utils.six.moves.urllib import parse as urlparse |
|
32 | 31 |
from httmock import HTTMock, all_requests |
33 | 32 |
from httmock import response as mock_response |
34 | 33 |
from pytest import fixture |
tests/test_views.py | ||
---|---|---|
17 | 17 |
import base64 |
18 | 18 |
import hashlib |
19 | 19 |
from unittest import mock |
20 |
from urllib.parse import parse_qs, urlparse |
|
20 | 21 | |
21 | 22 |
import lasso |
22 | 23 |
import pytest |
23 | 24 |
from django.urls import reverse |
24 | 25 |
from django.utils.encoding import force_text |
25 | 26 |
from django.utils.http import urlencode |
26 |
from django.utils.six.moves.urllib.parse import parse_qs, urlparse |
|
27 | 27 |
from httmock import HTTMock |
28 | 28 |
from utils import error_500, html_response |
29 | 29 |
from xml_utils import assert_xml_constraints |
30 |
- |