mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(test): Fixes for "TestClient" changes
Seems that client is optional according to the ASGI spec. https://asgi.readthedocs.io/en/latest/specs/www.html With Starlette 0.35 the TestClient connection scope is None for "client". https://github.com/encode/starlette/pull/2377 Signed-off-by: moson <moson@archlinux.org>
This commit is contained in:
parent
22e1577324
commit
2fcd793a58
8 changed files with 29 additions and 16 deletions
|
@ -67,7 +67,7 @@ def invalid_password(
|
|||
|
||||
|
||||
def is_banned(request: Request = None, **kwargs) -> None:
|
||||
host = request.client.host
|
||||
host = util.get_client_ip(request)
|
||||
exists = db.query(models.Ban, models.Ban.IPAddress == host).exists()
|
||||
if db.query(exists).scalar():
|
||||
raise ValidationError(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue