1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #11929 - Strip whitespace from csv headers (#11956)

* Strip whitespace from csv headers

* Move strip() call to parse_csv()

---------

Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
This commit is contained in:
kkthxbye
2023-03-13 15:55:18 +01:00
committed by GitHub
parent a71a59c088
commit e459c46dad

View File

@ -195,6 +195,7 @@ def parse_csv(reader):
# `site.slug` header, to indicate the related site is being referenced by its slug.
for header in next(reader):
header = header.strip()
if '.' in header:
field, to_field = header.split('.', 1)
headers[field] = to_field