Add alert if URL was skipped

This commit is contained in:
dgtlmoon
2023-11-03 14:53:23 +01:00
parent 460a7762e5
commit 0e4c39f1ef
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -194,6 +194,7 @@ class import_xlsx_wachete(Importer):
validate_url(data.get('url'))
except ValidationError as e:
print(">> import URL error", data.get('url'), str(e))
flash(f"Error processing row number {row_id}, URL value was incorrect, row was skipped.", 'error')
# Don't bother processing anything else on this row
continue
@@ -262,6 +263,7 @@ class import_xlsx_custom(Importer):
validate_url(url)
except ValidationError as e:
print(">> Import URL error", url, str(e))
flash(f"Error processing row number {row_i}, URL value was incorrect, row was skipped.", 'error')
# Don't bother processing anything else on this row
url = None
break
+2
View File
@@ -152,6 +152,8 @@ def test_import_custom_xlsx(client, live_server):
)
assert b'3 imported from custom .xlsx' in res.data
# Because this row was actually just a header with no usable URL, we should get an error
assert b'Error processing row number 1' in res.data
res = client.get(
url_for("index")