diff --git a/jsignature/fields.py b/jsignature/fields.py index 0fece1d..ff76904 100644 --- a/jsignature/fields.py +++ b/jsignature/fields.py @@ -12,13 +12,6 @@ JSIGNATURE_EMPTY_VALUES, ) -try: - from django.utils import six - - string_types = six.string_types -except ImportError: - string_types = str - class JSignatureField(models.Field): """ @@ -46,7 +39,7 @@ def to_python(self, value): def get_prep_value(self, value): if value in JSIGNATURE_EMPTY_VALUES: return None - elif isinstance(value, string_types): + elif isinstance(value, str): return value elif isinstance(value, list): return json.dumps(value) diff --git a/jsignature/widgets.py b/jsignature/widgets.py index dc1d65f..ed26dc2 100644 --- a/jsignature/widgets.py +++ b/jsignature/widgets.py @@ -17,13 +17,6 @@ JSIGNATURE_EMPTY_VALUES = validators.EMPTY_VALUES + ('[]', ) -try: - from django.utils import six - string_types = six.string_types -except ImportError: - string_types = str - - class JSignatureWidget(forms.HiddenInput): """ A widget handling a signature capture field with with jSignature @@ -73,7 +66,7 @@ def prep_value(self, value): """ Prepare value before effectively render widget """ if value in JSIGNATURE_EMPTY_VALUES: return "[]" - elif isinstance(value, string_types): + elif isinstance(value, str): return value elif isinstance(value, list): return json.dumps(value)