diff --git a/src-ui/cypress/fixtures/documents/1/comments.json b/src-ui/cypress/fixtures/documents/1/comments.json index 73e932187..a6013b513 100644 --- a/src-ui/cypress/fixtures/documents/1/comments.json +++ b/src-ui/cypress/fixtures/documents/1/comments.json @@ -6,8 +6,8 @@ "user": { "id": 1, "username": "user2", - "firstname": "", - "lastname": "" + "first_name": "", + "last_name": "" } }, { @@ -17,8 +17,8 @@ "user": { "id": 2, "username": "user1", - "firstname": "", - "lastname": "" + "first_name": "", + "last_name": "" } }, { @@ -28,8 +28,8 @@ "user": { "id": 2, "username": "user33", - "firstname": "", - "lastname": "" + "first_name": "", + "last_name": "" } }, { @@ -39,8 +39,8 @@ "user": { "id": 3, "username": "admin", - "firstname": "", - "lastname": "" + "first_name": "", + "last_name": "" } } ] diff --git a/src-ui/src/app/components/document-comments/document-comments.component.ts b/src-ui/src/app/components/document-comments/document-comments.component.ts index 06c383e98..f5c63ab07 100644 --- a/src-ui/src/app/components/document-comments/document-comments.component.ts +++ b/src-ui/src/app/components/document-comments/document-comments.component.ts @@ -92,8 +92,8 @@ export class DocumentCommentsComponent extends ComponentWithPermissions { displayName(comment: PaperlessDocumentComment): string { if (!comment.user) return '' let nameComponents = [] - if (comment.user.firstname) nameComponents.unshift(comment.user.firstname) - if (comment.user.lastname) nameComponents.unshift(comment.user.lastname) + if (comment.user.first_name) nameComponents.unshift(comment.user.first_name) + if (comment.user.last_name) nameComponents.unshift(comment.user.last_name) if (comment.user.username) { if (nameComponents.length > 0) nameComponents.push(`(${comment.user.username})`) diff --git a/src-ui/src/app/data/paperless-document-comment.ts b/src-ui/src/app/data/paperless-document-comment.ts index 14085cf32..884e59096 100644 --- a/src-ui/src/app/data/paperless-document-comment.ts +++ b/src-ui/src/app/data/paperless-document-comment.ts @@ -1,8 +1,8 @@ import { ObjectWithId } from './object-with-id' -import { User } from './user' +import { PaperlessUser } from './paperless-user' export interface PaperlessDocumentComment extends ObjectWithId { created?: Date comment?: string - user?: User + user?: PaperlessUser } diff --git a/src-ui/src/app/data/user.ts b/src-ui/src/app/data/user.ts deleted file mode 100644 index adf00e86b..000000000 --- a/src-ui/src/app/data/user.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ObjectWithId } from './object-with-id' - -export interface User extends ObjectWithId { - username: string - firstname: string - lastname: string -} diff --git a/src/documents/tests/test_api.py b/src/documents/tests/test_api.py index d876984bd..5c0e8ed71 100644 --- a/src/documents/tests/test_api.py +++ b/src/documents/tests/test_api.py @@ -1400,8 +1400,8 @@ class TestDocumentApi(DirectoriesMixin, APITestCase): "user": { "id": comment.user.id, "username": comment.user.username, - "firstname": comment.user.first_name, - "lastname": comment.user.last_name, + "first_name": comment.user.first_name, + "last_name": comment.user.last_name, }, }, ) diff --git a/src/documents/views.py b/src/documents/views.py index bc48faf03..a59afadb7 100644 --- a/src/documents/views.py +++ b/src/documents/views.py @@ -400,8 +400,8 @@ class DocumentViewSet( "user": { "id": c.user.id, "username": c.user.username, - "firstname": c.user.first_name, - "lastname": c.user.last_name, + "first_name": c.user.first_name, + "last_name": c.user.last_name, }, } for c in Comment.objects.filter(document=doc).order_by("-created")