Commit Graph

28 Commits

Author SHA1 Message Date
Michael Manganiello
8abbae4c02 misc: Make backend handle URLs with trailing slash
According to multiple FastAPI discussions [1], FastAPI only includes a
built-in mechanism to redirect requests including a trailing slash, to
its variation without slash, using a `307` status code.

This can be an issue when certain clients do not send the same headers
on the redirected request.

This change adds a custom FastAPI `APIRouter`, that registers both route
path variations (with and without trailing slash), while only marking
the path without slash for being included in the OpenAPI schema.

[1] https://github.com/fastapi/fastapi/discussions/7298
2024-08-07 00:22:21 -03:00
Michael Manganiello
749e4d65c1 misc: Use PYTEST_VERSION variable to detect Pytest runs
Pytest v8.2 introduced the `PYTEST_VERSION` environment variable [1],
that can be used to check if code is running from within a pytest run.

This way, we can avoid checking the loaded `sys` modules.

[1] https://docs.pytest.org/en/stable/changelog.html#id57
2024-07-27 12:03:44 -03:00
Michael Manganiello
d1fda9081f fix: Add missing awaits on read/write for async opened files 2024-07-27 00:38:05 -03:00
Michael Manganiello
c5b150c1eb fix: Enable flake8-async rules in ruff and fix warnings
`ASYNC` rules [1] tries to find issues regarding asynchronous code. This
change enables `ruff` to start reporting these issues, and fixes
existing warnings.

[1] https://docs.astral.sh/ruff/rules/#flake8-async-async
2024-07-26 21:40:46 -03:00
zurdi
1a3f74e8ac check username already exists on setup wizard 2024-07-08 11:56:10 +02:00
Zurdi
14e2377f3a fixes from PR review 2024-07-06 18:55:45 +02:00
Zurdi
4435093329 Update backend/endpoints/user.py
Co-authored-by: Georges-Antoine Assi <3247106+gantoine@users.noreply.github.com>
2024-07-06 18:53:29 +02:00
Zurdi
e9c33043e5 Merge branch 'master' into feature/user-own-edit 2024-07-06 18:41:55 +02:00
Zurdi
ca7d37a3b0 fixed unit tests 2024-07-06 17:40:13 +02:00
Zurdi
eda1c94868 fixed user endpoint tests 2024-07-05 19:16:47 +02:00
zurdi
9ff5eeb367 modified update user endpoint to allow own edition 2024-07-04 21:19:20 +02:00
zurdi
2ec4debd61 setup wizard added 2024-07-04 14:19:00 +02:00
Georges-Antoine Assi
880345f20c ruff-only pre-commit 2024-05-18 12:05:57 -04:00
Georges-Antoine Assi
2749aaee4a rename back to old names 2024-05-05 16:59:30 -04:00
Georges-Antoine Assi
9ad28f3294 more refactoring again 2024-05-05 16:32:40 -04:00
Georges-Antoine Assi
def2608c28 refactor db handlers 2024-05-05 15:46:07 -04:00
Georges-Antoine Assi
1a2c914045 refactor handlers out into own files 2024-05-05 12:45:56 -04:00
Georges-Antoine Assi
07cc82b627 Fix auth handling on user update 2024-03-06 09:53:29 -05:00
Georges-Antoine Assi
7ca551b743 switched to jwt backed sessions 2024-02-16 10:00:54 -05:00
Zurdi
1e9dac9eeb clean up user avatar code 2024-02-10 17:10:24 +01:00
Zurdi
e226a06531 create avatar path if not exists 2024-02-10 12:46:45 +01:00
Zurdi
0b3b353937 fixed user custom avatar location 2024-02-09 12:51:52 +01:00
Georges-Antoine Assi
6bcadec702 everything we need for 3.0 2024-02-01 18:13:16 -05:00
Georges-Antoine Assi
eb18388a81 Mega refactor of asset 2024-02-01 17:59:06 -05:00
Georges-Antoine Assi
81b5bcf9ba refactor handler names 2024-01-18 14:04:35 -05:00
Georges-Antoine Assi
9495942084 Fix the rest of the tests 2024-01-17 10:57:07 -05:00
Zurdi
0af3ffb86f refactor stats and user handlers 2024-01-17 01:43:16 +01:00
Zurdi
42065aec7c backend refactor as RESTful 2024-01-15 13:34:18 +01:00