Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tykling committed Dec 8, 2024
1 parent bb869ac commit 0c2ebd2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/files/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,13 @@ def upload( # noqa: C901,PLR0913
ts.save()
logger.debug(f"ThumbnailSource {ts.uuid} created for file {uploaded_file.uuid}")

# create jobs
uploaded_file.create_jobs()

# get file using the manager so the returned object has annotations
uploaded_file = BaseFile.bmanager.get(uuid=uploaded_file.uuid)

# create jobs
uploaded_file.create_jobs()
uploaded_file.refresh_from_db()

# all good
return 201, {"bma_response": uploaded_file, "message": f"File {uploaded_file.uuid} uploaded OK!"}

Expand Down
1 change: 0 additions & 1 deletion src/files/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,6 @@ def test_file_list_view_attribution_filters(self) -> None:
self.assert_file_list_rows(24, qs="?attribution__icontains=foto")
self.assert_file_list_rows(0, qs="?attribution__icontains=notthere")
self.assert_file_list_rows(1, qs="?attribution__icontains=fotofonzy")
self.assert_file_list_rows(1, qs="?attribution=fotoflummer")

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

0 comments on commit 0c2ebd2

Please sign in to comment.