Commit 5915de96 authored by Sli's avatar Sli

It's better to delete an object in delete

parent 73bd8b0f
Pipeline #1438 passed with stage
in 5 minutes and 48 seconds
......@@ -158,6 +158,7 @@ class Candidature(models.Model):
def delete(self):
for vote in self.votes.all():
vote.delete()
super(Candidature, self).delete()
def can_be_edited_by(self, user):
return (user == self.user) or user.can_edit(self.role.election)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment