From 2910fe863802ff129ce42c412cad3569c9573dbd Mon Sep 17 00:00:00 2001 From: tcely Date: Tue, 29 Jul 2025 01:48:22 -0400 Subject: [PATCH] Check the if condition before importing anything --- tubesync/common/huey.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tubesync/common/huey.py b/tubesync/common/huey.py index 1d86f748..434a24cb 100644 --- a/tubesync/common/huey.py +++ b/tubesync/common/huey.py @@ -404,13 +404,13 @@ def historical_task(signal_name, task_obj, exception_obj=None, /, *, huey=None): scheduled_at = huey.scheduled_at_from_task(task_obj) if scheduled_at: th.scheduled_at = scheduled_at - try: - from django.core.exceptions import ValidationError - from sync.models import Media, Source - except: - pass - else: - if not th.verbose_name: + if not th.verbose_name: + try: + from django.core.exceptions import ValidationError + from sync.models import Media, Source + except: + pass + else: try: key = task_obj.args[0] instance_uuid_str = str(key)