Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d6b0d19

Browse filesBrowse files
committed
fix: refactor helper functions to avoid circular dependencies
1 parent 10a5c3a commit d6b0d19
Copy full SHA for d6b0d19

File tree

Expand file treeCollapse file tree

2 files changed

+8
-4
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-4
lines changed

‎django_celery_results/models/generic.py

Copy file name to clipboardExpand all lines: django_celery_results/models/generic.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Database models."""
22

3-
import json
4-
53
from django.utils.translation import gettext_lazy as _
64

75
from django_celery_results.models.abstract import (
@@ -25,6 +23,8 @@ class ChordCounter(AbstractChordCounter):
2523
"""Chord synchronisation."""
2624

2725
class Meta(AbstractChordCounter.Meta):
26+
"""Table information."""
27+
2828
abstract = False
2929
app_label = "django_celery_results"
3030

‎django_celery_results/models/helpers.py

Copy file name to clipboardExpand all lines: django_celery_results/models/helpers.py
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
from django.conf import settings
33
from django.core.exceptions import ImproperlyConfigured
44

5-
from .generic import ChordCounter, GroupResult, TaskResult
6-
75

86
def taskresult_model():
97
"""Return the TaskResult model that is active in this project."""
108
if not hasattr(settings, 'CELERY_RESULTS_TASKRESULT_MODEL'):
9+
from .generic import TaskResult
10+
1111
return TaskResult
1212

1313
try:
@@ -31,6 +31,8 @@ def chordcounter_model():
3131
"""Return the ChordCounter model that is active in this project."""
3232

3333
if not hasattr(settings, 'CELERY_RESULTS_CHORDCOUNTER_MODEL'):
34+
from .generic import ChordCounter
35+
3436
return ChordCounter
3537

3638
try:
@@ -53,6 +55,8 @@ def chordcounter_model():
5355
def groupresult_model():
5456
"""Return the GroupResult model that is active in this project."""
5557
if not hasattr(settings, 'CELERY_RESULTS_GROUPRESULT_MODEL'):
58+
from .generic import GroupResult
59+
5660
return GroupResult
5761

5862
try:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.