diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-06-11 15:43:39 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-07-01 18:02:28 +0200 |
commit | 2a1a511712c3e5ecfc95e78679c52991c2eeb9de (patch) | |
tree | bf908de4a2cb408b4711873066d36b68355d7f83 /ishtar_common | |
parent | 20461888af9593d370a417e2e1e2c6ea19131b0b (diff) | |
download | Ishtar-2a1a511712c3e5ecfc95e78679c52991c2eeb9de.tar.bz2 Ishtar-2a1a511712c3e5ecfc95e78679c52991c2eeb9de.zip |
Fix celery import error when celery dependency is missing
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/utils.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index aae2783c7..6183cdc49 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -88,11 +88,13 @@ def fake_task(*args): return fake +task = fake_task if settings.USE_BACKGROUND_TASK: - from celery import shared_task - task = shared_task -else: - task = fake_task + try: + from celery import shared_task + task = shared_task + except ImportError: + pass class BColors: |