Skip to content

Commit

Permalink
Skip non-integer values when searching for client IDs.
Browse files Browse the repository at this point in the history
  • Loading branch information
voughtdq committed Apr 15, 2023
1 parent f4ff32e commit 3572243
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion startel_clients_html_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ def start(self):
with open(self.report_path, 'r') as report:
for block in report.read().split('<BR class=brk>'):
client_id = self._get_client_id(block)
client, created = ClientPage.objects.update_or_create(client_id=int(client_id), data=block)
try:
client_id = int(client_id)
except ValueError:
logger.warning(f'Skipping non-integer {client_id}')
continue

client, created = ClientPage.objects.update_or_create(client_id=client_id, data=block)

if created:
created_count += 1
Expand Down

0 comments on commit 3572243

Please sign in to comment.