Skip to content

Commit e241457

Browse files
committed
refact: typing
1 parent 7349c50 commit e241457

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ignore_missing_imports = True
5252
# TODO: reenable when ready
5353
# disallow_untyped_defs = True
5454
55-
exclude = frontend.py
55+
exclude = (frontend.py|setupwizard)
5656
5757
[isort]
5858
known_first_party = abilian

src/abilian/web/forms/widgets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ def init_columns(self, columns: Sequence[Union[str, Dict[str, Any]]]):
333333
column = col
334334
assert isinstance(column, dict)
335335
if "label" not in column:
336-
column["label"] = labelize(column["name"])
336+
name = str(column["name"])
337+
column["label"] = labelize(name)
337338

338339
column.setdefault("sorting", ["asc", "desc"])
339340

src/abilian/web/tests/test_validators.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Any, Callable, Iterator, Optional, Tuple, Union
3+
from typing import Callable, Iterator
44

55
from pytest import fixture, raises
66
from wtforms import Form, StringField
@@ -15,9 +15,7 @@ class DummyForm(Form):
1515

1616

1717
class DummyField:
18-
def __init__(
19-
self, data: str, errors: Tuple[()] = (), raw_data: Optional[Any] = None
20-
):
18+
def __init__(self, data: str, errors=(), raw_data=None):
2119
self.data = data
2220
self.errors = list(errors)
2321
self.raw_data = raw_data
@@ -32,7 +30,7 @@ def error_message(validator: Callable, form: DummyForm, field: DummyField) -> st
3230

3331

3432
@fixture()
35-
def validator() -> Iterator[Union[Iterator, Iterator[Callable]]]:
33+
def validator() -> Iterator[Callable]:
3634
yield siret_validator()
3735

3836

0 commit comments

Comments
 (0)