Changing instances of ugettext, ugettext_lazy, ungettext, and force_unicode for Django 4.0
Hi,
I don't know if people running Django 4.0 will be using django-celery but I had to make some fixes to djcelery in order to get it working.
I had to delete the u from:
ugettextto justgettextugettext_lazyto justgettext_lazyungettextto usengettextand then import itas ungettextto leave the rest of the code "reasonably unchanged".
Lastly I changed the force_unicode (force_text) import to import force_str as force_text
The files affected I think were:
- djcelery/admin.py
- djcelery/humanize.py
- djcelery/models.py
- djcelery/picklefield.py
It imports correctly now but I can keep you posted on if it breaks!
Hi,
I have changed files that you mention and did what you say, and now it throw an error like this :
File "/home/fariz/.virtualenvs/boxsurat/lib/python3.8/site-packages/djcelery/models.py", line 17, in
Hi,
I've been looking for a solution and doing this to got it working for a while but I don't know what effect I did
The files :
- djcelery/admin.py
- djcelery/picklefield.py
what I did:
- remove
from celery.five import with_metaclass - change
from celery.app.control import broadcast, revoke, rate_limittofrom celery.worker.control import revoke, rate_limit - change 'broadcast()' to
self.app.control.broadcast()
I hope it can work well