Add alert if URL was skipped

pull/1931/head
dgtlmoon 6 months ago
parent 460a7762e5
commit 0e4c39f1ef

@ -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

@ -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")

Loading…
Cancel
Save