Skip to content

Commit 013832b

Browse files
committed
remove six usage
1 parent ab0f201 commit 013832b

File tree

5 files changed

+4
-10
lines changed

5 files changed

+4
-10
lines changed

dynamic_preferences/forms.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from six import string_types
21
from django import forms
32
from django.core.exceptions import ValidationError
43
from collections import OrderedDict
@@ -85,7 +84,7 @@ def preference_form_builder(form_base_class, preferences=[], **kwargs):
8584
if len(preferences) > 0:
8685
# Preferences have been selected explicitly
8786
for pref in preferences:
88-
if isinstance(pref, string_types):
87+
if isinstance(pref, str):
8988
preferences_obj.append(registry.get(name=pref))
9089
elif type(pref) == tuple:
9190
preferences_obj.append(registry.get(name=pref[0], section=pref[1]))

dynamic_preferences/serializers.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import unicode_literals
21
import decimal
32
import os
43

@@ -20,7 +19,6 @@
2019
make_naive,
2120
get_default_timezone,
2221
)
23-
from six import string_types, text_type
2422
from django.db.models.fields.files import FieldFile
2523

2624

@@ -62,7 +60,7 @@ def to_python(cls, value, **kwargs):
6260

6361
@classmethod
6462
def to_db(cls, value, **kwargs):
65-
return text_type(cls.clean_to_db_value(value))
63+
return str(cls.clean_to_db_value(value))
6664

6765
@classmethod
6866
def clean_to_db_value(cls, value):
@@ -85,7 +83,7 @@ def to_python(self, value, **kwargs):
8583
raise NotImplementedError
8684

8785
def to_db(self, value, **kwargs):
88-
return text_type(self.clean_to_db_value(value))
86+
return str(self.clean_to_db_value(value))
8987

9088
def clean_to_db_value(self, value):
9189
return value
@@ -193,7 +191,7 @@ def to_python(cls, value, **kwargs):
193191
class StringSerializer(BaseSerializer):
194192
@classmethod
195193
def to_db(cls, value, **kwargs):
196-
if not isinstance(value, string_types):
194+
if not isinstance(value, str):
197195
raise cls.exception(
198196
"Cannot serialize, value {0} is not a string".format(value)
199197
)

dynamic_preferences/users/forms.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from six import string_types
21
from django import forms
32
from django.core.exceptions import ValidationError
43
from collections import OrderedDict

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
six
21
wheel==0.38.1
32
persisting_theory==1.0

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
include_package_data=True,
3535
install_requires=[
3636
"django>=3.2",
37-
"six",
3837
"persisting_theory==1.0",
3938
],
4039
license="BSD",

0 commit comments

Comments
 (0)