mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
Merge branch 'elections' into 'master'
It's better to delete an object in delete See merge request ae/Sith!140
This commit is contained in:
commit
5132eb49e4
@ -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