Skip to content

Commit

Permalink
reformat and fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
Buhle79 committed Feb 19, 2025
1 parent e456c13 commit 99b4e8b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion home/tests/test_content_import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ def test_media_link_warning_response(self, csv_impexp: ImportExport) -> None:
content = csv_impexp.export_content()
src, dst = csv_impexp.csvs2dicts(resp, content)

assert "media_link" not in src
assert "media_link" not in [item.keys() for item in dst]


@pytest.mark.django_db
Expand Down
17 changes: 13 additions & 4 deletions home/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,19 @@ def run(self):
logger.exception("Content import failed")

if len(importer.import_warnings) > 0:
self.result_queue.put((messages.WARNING, ["Content import successful", "Upload media on :",
[f"row {warning.row_num}: {warning.message}"
for warning in importer.import_warnings]
]))
self.result_queue.put(
(
messages.WARNING,
[
"Content import successful",
"Upload media on :",
[
f"row {warning.row_num}: {warning.message}"
for warning in importer.import_warnings
],
],
)
)
else:
self.result_queue.put((messages.SUCCESS, ["Content import successful"]))

Expand Down

0 comments on commit 99b4e8b

Please sign in to comment.