Skip to content

Commit c1e2e14

Browse files
committed
Move unquote_plus import to compat.py
1 parent 5074e87 commit c1e2e14

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

oauth2_provider/compat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
from urllib.parse import urlparse, parse_qs, urlunparse
1616

1717
try:
18-
from urllib import urlencode
18+
from urllib import urlencode, unquote_plus
1919
except ImportError:
20-
from urllib.parse import urlencode
20+
from urllib.parse import urlencode, unquote_plus
2121

2222
# Django 1.5 add support for custom auth user model
2323
if django.VERSION >= (1, 5):

oauth2_provider/oauth2_validators.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
from __future__ import unicode_literals
22

33
import base64
4-
try:
5-
from urllib.parse import unquote_plus
6-
except ImportError:
7-
from urllib import unquote_plus
84
import logging
95
from datetime import timedelta
106

117
from django.utils import timezone
128
from django.contrib.auth import authenticate
139
from oauthlib.oauth2 import RequestValidator
1410

11+
from .compat import unquote_plus
1512
from .models import Grant, AccessToken, RefreshToken, get_application_model
1613
from .settings import oauth2_settings
1714

0 commit comments

Comments
 (0)