Skip to content

Commit

Permalink
Remove six usage
Browse files Browse the repository at this point in the history
  • Loading branch information
SebCorbin committed Jan 27, 2024
1 parent 25ac347 commit bfbb1d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
9 changes: 1 addition & 8 deletions jsignature/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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)
Expand Down
9 changes: 1 addition & 8 deletions jsignature/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit bfbb1d9

Please sign in to comment.