Compare commits

..

1 Commits

Author SHA1 Message Date
Jonas Schäfer
c856afee82 Pin wtforms to 2.x
wtforms 3.0 is incompatible with our code. A separate issue will be
filed to address the incompatibilities, but this should be enough to get
working images out of it.

With 3.x, we're seeing:

```
  File "/home/horazont/Projects/python/snikket-web-portal/snikket_web/main.py", line 35, in LoginForm
    address = wtforms.TextField(
AttributeError: module 'wtforms' has no attribute 'TextField'
```

and the portal fails to start.
2021-11-08 18:07:34 +01:00
2 changed files with 7 additions and 1 deletions

View File

@@ -5,4 +5,5 @@ hsluv~=0.0.2
flask-babel~=1.0
email-validator~=1.1
environ-config~=20.0
wtforms~=2.3
typing-extensions

View File

@@ -63,6 +63,9 @@ async def users() -> str:
)
_LIMITED_ROLE_NAME = _("Limited")
class EditUserForm(BaseForm):
localpart = wtforms.StringField(
_l("Login name"),
@@ -75,7 +78,9 @@ class EditUserForm(BaseForm):
role = wtforms.RadioField(
_l("Access Level"),
choices=[
("prosody:restricted", _("Limited")),
# NOTE: enable this only after something has been done which
# actually enforces the described restrictions :).
# ("prosody:restricted", _LIMITED_ROLE_NAME),
("prosody:normal", _l("Normal user")),
("prosody:admin", _l("Administrator")),
],