mirror of
https://github.com/ae-utbm/sith.git
synced 2024-10-31 19:38:04 +00:00
It's better to delete an object in delete
This commit is contained in:
parent
73bd8b0fd3
commit
5915de9603
@ -158,6 +158,7 @@ class Candidature(models.Model):
|
|||||||
def delete(self):
|
def delete(self):
|
||||||
for vote in self.votes.all():
|
for vote in self.votes.all():
|
||||||
vote.delete()
|
vote.delete()
|
||||||
|
super(Candidature, self).delete()
|
||||||
|
|
||||||
def can_be_edited_by(self, user):
|
def can_be_edited_by(self, user):
|
||||||
return (user == self.user) or user.can_edit(self.role.election)
|
return (user == self.user) or user.can_edit(self.role.election)
|
||||||
|
Loading…
Reference in New Issue
Block a user