Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AE UTBM
Sith
Commits
5132eb49
Commit
5132eb49
authored
Dec 12, 2017
by
Sli
Browse files
Merge branch 'elections' into 'master'
It's better to delete an object in delete See merge request ae/Sith!140
parents
73bd8b0f
5915de96
Pipeline
#1439
passed with stage
in 5 minutes and 47 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
election/models.py
View file @
5132eb49
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment