From 45766f2e20594c118d091a25ddbaec38f1e9d85c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyrill=20K=C3=BCttel?= Date: Thu, 27 Jun 2024 11:57:50 +0200 Subject: [PATCH] Fix type checking --- setup.cfg | 2 +- src/privatim/forms/fields/fields.py | 2 +- src/privatim/models/password_change_token.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index e566d0a..d00ebf5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -132,7 +132,7 @@ test = [flake8] extend-select = B901, B903, B904, B908, TC2 per_file_ignores = - *.pyi: E301, E302, E305, E501, E701, F401, F403, F405, F822, TC + *.pyi: E301, E302, E305, E501, E701, F401, F403, F405, F822, TC, NQA102 tests/**.py: NQA104, TC noqa-require-code = true type-checking-sqlalchemy-enabled = true diff --git a/src/privatim/forms/fields/fields.py b/src/privatim/forms/fields/fields.py index d98c1ea..720a150 100644 --- a/src/privatim/forms/fields/fields.py +++ b/src/privatim/forms/fields/fields.py @@ -382,7 +382,7 @@ def append_entry_from_field_storage( # we fake the formdata for the new field # we use a werkzeug MultiDict because the WebOb version # needs to get wrapped to be usable in WTForms - formdata: MultiDict[str, 'RawFormValue'] = MultiDict() + formdata = MultiDict() # type: ignore name = f'{self.short_name}{self._separator}{len(self)}' formdata.add(name, fs) return self._add_entry(formdata) diff --git a/src/privatim/models/password_change_token.py b/src/privatim/models/password_change_token.py index c3d9f35..cc24d40 100644 --- a/src/privatim/models/password_change_token.py +++ b/src/privatim/models/password_change_token.py @@ -30,7 +30,7 @@ class PasswordChangeToken(Base): token: Mapped[str] = mapped_column(String) ip_address: Mapped[str] = mapped_column(String) - user: Mapped['User'] = relationship(lazy='joined') + user: Mapped[User] = relationship(lazy='joined') def __init__( self,