Projet

Général

Profil

0001-misc-remove-usage-of-django.utils.six-63686.patch

Frédéric Péters, 15 avril 2022 16:45

Télécharger (2,78 ko)

Voir les différences:

Subject: [PATCH] misc: remove usage of django.utils.six (#63686)

 welco/sources/mail/maarch.py | 11 +++++------
 welco/utils.py               |  6 +++---
 2 files changed, 8 insertions(+), 9 deletions(-)
welco/sources/mail/maarch.py
15 15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 16

  
17 17
import base64
18
import urllib.parse
18 19

  
19 20
import requests
20 21
from dateutil.parser import parse as parse_datetime
21
from django.utils import six
22
from django.utils.six.moves.urllib import parse as urlparse
23 22
from requests.adapters import HTTPAdapter
24 23
from requests.packages.urllib3.util.retry import Retry
25 24

  
......
152 151

  
153 152
    @property
154 153
    def list_url(self):
155
        return urlparse.urljoin(self.url, 'rest/res/list')
154
        return urllib.parse.urljoin(self.url, 'rest/res/list')
156 155

  
157 156
    @property
158 157
    def update_external_infos_url(self):
159
        return urlparse.urljoin(self.url, 'rest/res/externalInfos')
158
        return urllib.parse.urljoin(self.url, 'rest/res/externalInfos')
160 159

  
161 160
    @property
162 161
    def update_status_url(self):
163
        return urlparse.urljoin(self.url, 'rest/res/resource/status')
162
        return urllib.parse.urljoin(self.url, 'rest/res/resource/status')
164 163

  
165 164
    @property
166 165
    def post_courrier_url(self):
167
        return urlparse.urljoin(self.url, 'rest/res')
166
        return urllib.parse.urljoin(self.url, 'rest/res')
168 167

  
169 168
    def get_courriers(self, clause, fields=None, limit=None, include_file=False, order_by=None):
170 169
        if fields:
welco/utils.py
21 21
import json
22 22
import random
23 23
import re
24
import urllib.parse
24 25

  
25 26
import requests
26 27
from django.conf import settings
......
28 29
from django.http import HttpResponse, HttpResponseBadRequest
29 30
from django.utils.encoding import smart_bytes
30 31
from django.utils.http import quote, urlencode
31
from django.utils.six.moves.urllib import parse as urlparse
32 32

  
33 33

  
34 34
def sign_url(url, key, algo='sha256', timestamp=None, nonce=None):
35
    parsed = urlparse.urlparse(url)
35
    parsed = urllib.parse.urlparse(url)
36 36
    new_query = sign_query(parsed.query, key, algo, timestamp, nonce)
37
    return urlparse.urlunparse(parsed[:4] + (new_query,) + parsed[5:])
37
    return urllib.parse.urlunparse(parsed[:4] + (new_query,) + parsed[5:])
38 38

  
39 39

  
40 40
def sign_query(query, key, algo='sha256', timestamp=None, nonce=None):
41
-