mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-09-23 22:06:58 +00:00
Add alert if URL was skipped
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user