From f9336eb0b453b01abc7d8610a8a06d7437161421 Mon Sep 17 00:00:00 2001 From: Corey Shields Date: Sat, 27 Jul 2019 14:17:16 -0400 Subject: [PATCH] Linting for R0401 Fixes a cyclical dependency between calling the celery app through an import in tasks.py (which then imports tasks.py) by retrieving celery through the class. Tested in local dev Signed-off-by: Corey Shields --- .pylintrc | 1 - db/base/tasks.py | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index 14ed061..a24d1a8 100644 --- a/.pylintrc +++ b/.pylintrc @@ -7,6 +7,5 @@ ignored-argument-names=args|kwargs disable= C0412, E1101, - R0401, R0801, # needs to remain disabled see https://github.com/PyCQA/pylint/issues/214 W0511, diff --git a/db/base/tasks.py b/db/base/tasks.py index fce4d60..800c184 100644 --- a/db/base/tasks.py +++ b/db/base/tasks.py @@ -6,6 +6,7 @@ import csv import logging from datetime import datetime, timedelta +from celery import Celery from django.conf import settings from django.contrib.sites.models import Site from django.core.mail import send_mail @@ -17,10 +18,10 @@ from sgp4.io import twoline2rv from db.base.models import DemodData, Satellite from db.base.utils import cache_statistics, decode_data -from db.celery import APP LOGGER = logging.getLogger('db') +APP = Celery('db') @APP.task(task_ignore_result=False) def check_celery():