From c8284e332619a93b2f356d50183c45a9f5a94360 Mon Sep 17 00:00:00 2001 From: Vemund Santi Date: Tue, 7 May 2019 16:36:58 +0200 Subject: [PATCH] fix: remove logging. Use continue if digas_id is used --- .../migrations/0024_populate_show_digas_id.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/data_models/migrations/0024_populate_show_digas_id.py b/data_models/migrations/0024_populate_show_digas_id.py index 0236361..a0362a1 100644 --- a/data_models/migrations/0024_populate_show_digas_id.py +++ b/data_models/migrations/0024_populate_show_digas_id.py @@ -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: @@ -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()