def may_toggle_vote(user, image): may, reason = may_toggle_vote_image(user, image) return may
def may_not_toggle_vote_reason(user, image): may, reason = may_toggle_vote_image(user, image) return reason
def clean(self): may, reason = may_toggle_vote_image(self.reviewer, self.image) if not may: raise ValidationError(reason)