Skip to content

Commit

Permalink
fix for rsl import
Browse files Browse the repository at this point in the history
  • Loading branch information
drkane committed Jun 21, 2024
1 parent 8868c4c commit c259a3c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions ftc/management/commands/import_rsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,10 @@ def parse_file(self, response, source_url):
if not table:
raise ValueError("No table found in {}".format(link))

headers = None
for k, row in enumerate(table.find("tr")):
if not headers:
headers = [c.text.lower() for c in row.find("td")]
else:
record = dict(zip(headers, [c.text for c in row.find("td")]))
self.parse_row(record)
headers = [c.text.lower() for c in table.find("thead", first=True).find("th")]
for k, row in enumerate(table.find("tbody", first=True).find("tr")):
record = dict(zip(headers, [c.text for c in row.find("td")]))
self.parse_row(record)

def parse_row(self, record):
record = self.clean_fields(record)
Expand Down

0 comments on commit c259a3c

Please sign in to comment.