Ejemplo n.º 1
0
    def delete(self, *args, **kwargs):
        """Override delete method to update parent forum info."""
        forum = Forum.uncached.get(pk=self.forum.id)
        if forum.last_post and forum.last_post.thread_id == self.id:
            forum.update_last_post(exclude_thread=self)
            forum.save()

        delete_watches.delay(Thread, self.pk)

        super(Thread, self).delete(*args, **kwargs)
Ejemplo n.º 2
0
 def delete(self, *args, **kwargs):
     """Override delete to trigger delete_watches."""
     delete_watches.delay(Question, self.pk)
     super(Question, self).delete(*args, **kwargs)
Ejemplo n.º 3
0
 def delete(self, *args, **kwargs):
     """Override delete method to remove watches."""
     delete_watches.delay(Thread, self.pk)
     super(Thread, self).delete(*args, **kwargs)