Ignore wrong formatted row
This commit is contained in:
parent
76175dc517
commit
d14f6cf7fb
|
@ -102,8 +102,12 @@ def handle_batch_import(batch_import: BatchImport):
|
||||||
reader = csv.DictReader(lines)
|
reader = csv.DictReader(lines)
|
||||||
|
|
||||||
for row in reader:
|
for row in reader:
|
||||||
full_alias = row["alias"].lower().strip().replace(" ", "")
|
try:
|
||||||
note = row["note"]
|
full_alias = row["alias"].lower().strip().replace(" ", "")
|
||||||
|
note = row["note"]
|
||||||
|
except KeyError:
|
||||||
|
LOG.warning("Cannot parse row %s", row)
|
||||||
|
continue
|
||||||
|
|
||||||
alias_domain = get_email_domain_part(full_alias)
|
alias_domain = get_email_domain_part(full_alias)
|
||||||
custom_domain = CustomDomain.get_by(domain=alias_domain)
|
custom_domain = CustomDomain.get_by(domain=alias_domain)
|
||||||
|
|
Loading…
Reference in New Issue