pinax-badges
pinax-badges copied to clipboard
AttributeError with async_ = True
TestAsyncBadge
class TestAsyncBadge(Badge):
async_ = True
slug = "test_async_badge"
levels = [
...
]
events = [
"something_awarded",
]
multiple = False
def award(self, **state):
...
badges.register(TestAsyncBadge)
def test_func(self):
badges.possibly_award_badge("something_awarded", user=self.user)
File "/usr/local/lib/python3.8/dist-packages/celery/app/task.py", line 426, in delay
return self.apply_async(args, kwargs)
AttributeError: 'TestAsyncBadge' object has no attribute 'apply_async'
Celery.py
app = Celery('appname')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
celery 4.4.7
I have the same problem with celery==5.0.5
@Loneattic @eon01 if you can, maybe try the proposed changes in #43 and see if that resolves your issue? You can run:
pip install -e git+https://github.com/piraka9011/pinax-badges.git