mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-24 18:14:22 +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):
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user