Skip to content

Commit

Permalink
fix: remove logging. Use continue if digas_id is used
Browse files Browse the repository at this point in the history
  • Loading branch information
santi committed May 7, 2019
1 parent 9eb278b commit 5b9d5da
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions data_models/migrations/0024_populate_show_digas_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def populate_digas_id(apps, schema_editor):
if show.digas_id:
continue

not_updated = True
max_tries = 15
for i in range(max_tries):
try:
Expand All @@ -40,14 +41,9 @@ def populate_digas_id(apps, schema_editor):

# We found something!
digas_id = digas_id_by_on_demand_link[sod_url]
if digas_id in used_digas_ids:
# Alert the user and don't update this show.
log.error('Duplicate digas_id encountered for {show}.' + \
'digas_id not updated.'.format(
show=show.name,
)
)
break
if digas_id in used_digas_ids:
# Keep checking next episode. Perhaps it has an unused ID
continue

show.digas_id = digas_id
show.save()
Expand Down

0 comments on commit 5b9d5da

Please sign in to comment.