1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-09 03:36:48 +00:00

fix(accounts): knox creates no table of its own

knox's first migration creates its AuthToken table even when
KNOX_TOKEN_MODEL replaces it with accounts.ApiToken. The unused
knox_authtoken table references auth_user, and Django, which does not see
it, does not empty it with the others: on PostgreSQL every test that
empties the database failed ("cannot truncate a table referenced in a
foreign key constraint"). SQLite does not check this, so only CI's
PostgreSQL leg showed it. knox stays installed for its token code, with
its migrations turned off (MIGRATION_MODULES).
This commit is contained in:
catborise 2026-10-24 23:20:23 +03:00
parent 1c60696ea1
commit d9088b410e
2 changed files with 10 additions and 0 deletions

View file

@ -381,6 +381,9 @@ REST_FRAMEWORK = {
# "Authorization: Token wvc_..."; made and deleted on the profile page
KNOX_TOKEN_MODEL = "accounts.ApiToken"
REST_KNOX = {"TOKEN_PREFIX": "wvc_"}
# knox stays installed for its token code, but its migrations would create a
# knox_authtoken table that accounts.ApiToken replaces
MIGRATION_MODULES = {"knox": None}
SPECTACULAR_SETTINGS = {
"TITLE": "Webvirtcloud REST-API",