fix: split_strip() arg must be str

This commit is contained in:
relikd
2022-08-06 17:45:38 +02:00
parent e67489ab0b
commit 5387256b93
2 changed files with 4 additions and 2 deletions

View File

@@ -52,13 +52,15 @@ class Config:
def set_order_by(self, order_by: Optional[str]) -> None:
''' If specified, children will be sorted according to keys. '''
self.order_by = split_strip(order_by, ',') or None
self.order_by = split_strip(order_by or '', ',') or None
def __repr__(self) -> str:
txt = '<GroupByConfig'
for x in ['key', 'root', 'slug', 'template', 'enabled']:
txt += ' {}="{}"'.format(x, getattr(self, x))
txt += f' fields="{", ".join(self.fields)}"'
if self.order_by:
txt += ' order_by="{}"'.format(' ,'.join(self.order_by))
return txt + '>'
@staticmethod