M callback/callback.py +1 -0
@@ 53,6 53,7 @@ class CallbackManager(object):
cls = self.get_callback_class(model)
try:
cls.process(model)
+ callback_instance.mark_complete()
except Exception, e:
callback_instance.mark_error(str(e))
raise CallbackException(str(e))
M callback/models.py +8 -0
@@ 22,6 22,14 @@ class CallbackMap(models.Model):
objects = CallbackMapManager()
# Methods
+ def __unicode__(self):
+ return self.hash_id
+
+ def mark_complete(self):
+ self.is_active = False
+ self.is_error = False
+ self.save()
+
def mark_error(self, msg):
self.is_active = False
self.is_error = True