mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-05-07 11:49:48 -05:00
Fix: correctly handle empty user for old notes api format, fix frontend API version (#9846)
This commit is contained in:
parent
c83b0bfca6
commit
86adc377a0
@ -3,7 +3,7 @@ const base_url = new URL(document.baseURI)
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: true,
|
production: true,
|
||||||
apiBaseUrl: document.baseURI + 'api/',
|
apiBaseUrl: document.baseURI + 'api/',
|
||||||
apiVersion: '7',
|
apiVersion: '8', // match src/paperless/settings.py
|
||||||
appTitle: 'Paperless-ngx',
|
appTitle: 'Paperless-ngx',
|
||||||
version: '2.15.3',
|
version: '2.15.3',
|
||||||
webSocketHost: window.location.host,
|
webSocketHost: window.location.host,
|
||||||
|
@ -885,7 +885,7 @@ class NotesSerializer(serializers.ModelSerializer):
|
|||||||
request.version if request else settings.REST_FRAMEWORK["DEFAULT_VERSION"],
|
request.version if request else settings.REST_FRAMEWORK["DEFAULT_VERSION"],
|
||||||
)
|
)
|
||||||
|
|
||||||
if api_version < 8:
|
if api_version < 8 and "user" in ret:
|
||||||
user_id = ret["user"]["id"]
|
user_id = ret["user"]["id"]
|
||||||
ret["user"] = user_id
|
ret["user"] = user_id
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ REST_FRAMEWORK = {
|
|||||||
"rest_framework.authentication.SessionAuthentication",
|
"rest_framework.authentication.SessionAuthentication",
|
||||||
],
|
],
|
||||||
"DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.AcceptHeaderVersioning",
|
"DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.AcceptHeaderVersioning",
|
||||||
"DEFAULT_VERSION": "8",
|
"DEFAULT_VERSION": "8", # match src-ui/src/environments/environment.prod.ts
|
||||||
# Make sure these are ordered and that the most recent version appears
|
# Make sure these are ordered and that the most recent version appears
|
||||||
# last. See api.md#api-versioning when adding new versions.
|
# last. See api.md#api-versioning when adding new versions.
|
||||||
"ALLOWED_VERSIONS": ["1", "2", "3", "4", "5", "6", "7", "8"],
|
"ALLOWED_VERSIONS": ["1", "2", "3", "4", "5", "6", "7", "8"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user