'Override delete method to update parent question info.'

def delete(self, *args, **kwargs):

    question = Question.objects.get(pk=self.question.id)
    if (question.last_answer == self):
        answers = question.answers.all().order_by('-created')
        try:
            question.last_answer = answers[1]
        except IndexError:
            question.last_answer = None
    if (question.solution == self):
        question.solution = None
    answers = question.answers.filter(is_spam=False)
    question.num_answers = (answers.count() - 1)
    question.save()
    question.clear_cached_contributors()
    super(Answer, self).delete(*args, **kwargs)
    update_answer_pages.delay(question)
