mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 01:39:18 +02:00
Blacked the code
This commit is contained in:
parent
b6fc0051fa
commit
62ca3bd736
279 changed files with 8861 additions and 9527 deletions
|
@ -17,7 +17,7 @@ def get(pref):
|
|||
|
||||
|
||||
class StringListSerializer(serializers.BaseSerializer):
|
||||
separator = ','
|
||||
separator = ","
|
||||
sort = True
|
||||
|
||||
@classmethod
|
||||
|
@ -27,8 +27,8 @@ class StringListSerializer(serializers.BaseSerializer):
|
|||
|
||||
if type(value) not in [list, tuple]:
|
||||
raise cls.exception(
|
||||
"Cannot serialize, value {} is not a list or a tuple".format(
|
||||
value))
|
||||
"Cannot serialize, value {} is not a list or a tuple".format(value)
|
||||
)
|
||||
|
||||
if cls.sort:
|
||||
value = sorted(value)
|
||||
|
@ -38,7 +38,7 @@ class StringListSerializer(serializers.BaseSerializer):
|
|||
def to_python(cls, value, **kwargs):
|
||||
if not value:
|
||||
return []
|
||||
return value.split(',')
|
||||
return value.split(",")
|
||||
|
||||
|
||||
class StringListPreference(types.BasePreferenceType):
|
||||
|
@ -47,5 +47,5 @@ class StringListPreference(types.BasePreferenceType):
|
|||
|
||||
def get_api_additional_data(self):
|
||||
d = super(StringListPreference, self).get_api_additional_data()
|
||||
d['choices'] = self.get('choices')
|
||||
d["choices"] = self.get("choices")
|
||||
return d
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue