FIX: Get rid of basestring (not python3 compatible).
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from django.apps import apps
|
||||
from six import string_types
|
||||
|
||||
from dav_base.tests.generic import AppSetting, AppsTestCase
|
||||
|
||||
@@ -7,6 +8,6 @@ class TestCase(AppsTestCase):
|
||||
app_config = apps.get_app_config('dav_auth')
|
||||
|
||||
settings = (
|
||||
AppSetting('login_redirect_url', basestring),
|
||||
AppSetting('logout_redirect_url', basestring),
|
||||
AppSetting('login_redirect_url', string_types),
|
||||
AppSetting('logout_redirect_url', string_types),
|
||||
)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from django.apps import apps
|
||||
from six import string_types
|
||||
|
||||
from .generic import AppSetting, AppsTestCase
|
||||
|
||||
@@ -7,7 +8,7 @@ class TestCase(AppsTestCase):
|
||||
app_config = apps.get_app_config('dav_base')
|
||||
|
||||
settings = (
|
||||
AppSetting('email_sender', basestring),
|
||||
AppSetting('email_base_url', basestring),
|
||||
AppSetting('email_subject_prefix', basestring),
|
||||
AppSetting('email_sender', string_types),
|
||||
AppSetting('email_base_url', string_types),
|
||||
AppSetting('email_subject_prefix', string_types),
|
||||
)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import datetime
|
||||
import logging
|
||||
import re
|
||||
from six import string_types
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -53,7 +54,7 @@ class Iso8601Serializer(object):
|
||||
@classmethod
|
||||
def deserialize(cls, value, ignore_unsupported_input=False):
|
||||
prefix = '{marker}{sep}'.format(marker=cls.marker, sep=cls.separator)
|
||||
if isinstance(value, basestring) and value.startswith(prefix):
|
||||
if isinstance(value, string_types) and value.startswith(prefix):
|
||||
haystack = value[len(prefix):]
|
||||
m = cls._re.match(haystack)
|
||||
if m is not None:
|
||||
@@ -68,6 +69,6 @@ class Iso8601Serializer(object):
|
||||
elif not ignore_unsupported_input:
|
||||
raise ValueError('Format not recognized \'{str}\''.format(str=haystack))
|
||||
elif not ignore_unsupported_input:
|
||||
raise ValueError('Expected basestring,'
|
||||
raise ValueError('Expected string type,'
|
||||
' not {}'.format(value.__class__.__name__))
|
||||
return value
|
||||
|
||||
@@ -9,6 +9,7 @@ from django.apps import apps
|
||||
from django.utils.translation import get_language, ugettext, ugettext_lazy as _
|
||||
from django_countries.fields import Country, LazyTypedChoiceField
|
||||
from datetimewidget.widgets import DateWidget, TimeWidget, DateTimeWidget
|
||||
from six import string_types
|
||||
|
||||
from .. import choices
|
||||
from .. import config
|
||||
@@ -162,7 +163,7 @@ class EventCreateForm(ModelMixin, ChainedForm):
|
||||
kwargs = self._session_data.copy()
|
||||
if 'deadline' in kwargs:
|
||||
buf = kwargs['deadline']
|
||||
if isinstance(buf, basestring):
|
||||
if isinstance(buf, string_types):
|
||||
deadline_choice = buf.lower()
|
||||
deadline_field = 'deadline_{}'.format(deadline_choice)
|
||||
if deadline_field in kwargs:
|
||||
|
||||
Reference in New Issue
Block a user