Created
August 28, 2014 20:32
-
-
Save NekoTashi/a8e101b59a92e81fb839 to your computer and use it in GitHub Desktop.
You can use a boolean field and name it something like celery_retry and in models save method do something like this.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save(self, *args, **kwargs): | |
if self.celery_retry and self.user.is_superuser(): | |
celery_task.apply_async() | |
self.celery_retry = False | |
super(MyModel, self).save(*args, **kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment