Skip to content

Commit 0c2ebd2

Browse files
committed
fix unit tests
1 parent bb869ac commit 0c2ebd2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/files/api.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,13 @@ def upload( # noqa: C901,PLR0913
159159
ts.save()
160160
logger.debug(f"ThumbnailSource {ts.uuid} created for file {uploaded_file.uuid}")
161161

162-
# create jobs
163-
uploaded_file.create_jobs()
164-
165162
# get file using the manager so the returned object has annotations
166163
uploaded_file = BaseFile.bmanager.get(uuid=uploaded_file.uuid)
167164

165+
# create jobs
166+
uploaded_file.create_jobs()
167+
uploaded_file.refresh_from_db()
168+
168169
# all good
169170
return 201, {"bma_response": uploaded_file, "message": f"File {uploaded_file.uuid} uploaded OK!"}
170171

src/files/tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,6 @@ def test_file_list_view_attribution_filters(self) -> None:
975975
self.assert_file_list_rows(24, qs="?attribution__icontains=foto")
976976
self.assert_file_list_rows(0, qs="?attribution__icontains=notthere")
977977
self.assert_file_list_rows(1, qs="?attribution__icontains=fotofonzy")
978-
self.assert_file_list_rows(1, qs="?attribution=fotoflummer")
979978

980979
def test_file_list_view_license_filters(self) -> None:
981980
"""Test the license filter of the file list view."""

0 commit comments

Comments
 (0)