mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-12 00:02:36 -05:00
fix BOM issue again
This commit is contained in:
@@ -402,12 +402,7 @@ def extract_phones(job):
|
|||||||
phone_index = 0
|
phone_index = 0
|
||||||
for item in first_row:
|
for item in first_row:
|
||||||
# Note: may contain a BOM and look like \ufeffphone number
|
# Note: may contain a BOM and look like \ufeffphone number
|
||||||
if item.lower() in [
|
if item.lower().lstrip("\ufeff") == "phone number":
|
||||||
"phone number",
|
|
||||||
"\\ufeffphone number",
|
|
||||||
"\\ufeffphone number\n",
|
|
||||||
"phone number\n",
|
|
||||||
]:
|
|
||||||
break
|
break
|
||||||
phone_index = phone_index + 1
|
phone_index = phone_index + 1
|
||||||
|
|
||||||
@@ -419,7 +414,8 @@ def extract_phones(job):
|
|||||||
if phone_index >= len(row):
|
if phone_index >= len(row):
|
||||||
phones[job_row] = "Unavailable"
|
phones[job_row] = "Unavailable"
|
||||||
current_app.logger.error(
|
current_app.logger.error(
|
||||||
"Corrupt csv file, missing columns or possibly a byte order mark in the file",
|
f"Corrupt csv file, missing columns or\
|
||||||
|
possibly a byte order mark in the file, row looks like {row}",
|
||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user