mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: Fix middleware checking for accepted terms
The current query is a bit mixed up. The intention was to return the number of unaccepted records. Now it does also count all records that were accepted by some other user though. Let's check the total number of terms vs. the number of accepted records (by our user) instead. Signed-off-by: moson <moson@archlinux.org>
This commit is contained in:
parent
5729d6787f
commit
bc03d8b8f2
2 changed files with 14 additions and 11 deletions
|
@ -1915,6 +1915,12 @@ def test_get_terms_of_service(client: TestClient, user: User):
|
|||
# We accepted the term, there's nothing left to accept.
|
||||
assert response.status_code == int(HTTPStatus.SEE_OTHER)
|
||||
|
||||
# Make sure we don't get redirected to /tos when browsing "Home"
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get("/")
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
# Bump the term's revision.
|
||||
with db.begin():
|
||||
term.Revision = 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue