Fix some stuff

This commit is contained in:
shamoon 2025-04-03 22:24:04 -07:00
parent 1b6415fb42
commit 05937c7e02
4 changed files with 8 additions and 3 deletions

View File

@ -722,7 +722,7 @@ def run_workflows(
timezone.localtime(document.added), timezone.localtime(document.added),
document.original_filename or "", document.original_filename or "",
document.filename or "", document.filename or "",
timezone.localtime(document.created), document.created,
) )
except Exception: except Exception:
logger.exception( logger.exception(

View File

@ -1,3 +1,4 @@
from datetime import date
from datetime import datetime from datetime import datetime
from pathlib import Path from pathlib import Path
@ -10,7 +11,7 @@ def parse_w_workflow_placeholders(
local_added: datetime, local_added: datetime,
original_filename: str, original_filename: str,
filename: str, filename: str,
created: datetime | None = None, created: date | None = None,
doc_title: str | None = None, doc_title: str | None = None,
doc_url: str | None = None, doc_url: str | None = None,
) -> str: ) -> str:

View File

@ -474,7 +474,7 @@ class TestApiAuth(DirectoriesMixin, APITestCase):
self.client.force_authenticate(user1) self.client.force_authenticate(user1)
response = self.client.get( response = self.client.get(
"/api/documents/", "/api/documents/?ordering=-id",
format="json", format="json",
) )

View File

@ -1,3 +1,5 @@
from datetime import date
from django.contrib.auth.models import Permission from django.contrib.auth.models import Permission
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.core.cache import cache from django.core.cache import cache
@ -116,6 +118,7 @@ class TestTrashAPI(APITestCase):
checksum="checksum", checksum="checksum",
mime_type="application/pdf", mime_type="application/pdf",
owner=self.user, owner=self.user,
created=date(2023, 1, 1),
) )
document_u1.delete() document_u1.delete()
document_not_owned = Document.objects.create( document_not_owned = Document.objects.create(
@ -123,6 +126,7 @@ class TestTrashAPI(APITestCase):
content="content2", content="content2",
checksum="checksum2", checksum="checksum2",
mime_type="application/pdf", mime_type="application/pdf",
created=date(2023, 1, 2),
) )
document_not_owned.delete() document_not_owned.delete()
user2 = User.objects.create_user(username="user2") user2 = User.objects.create_user(username="user2")