Commit 13ac90a4 authored by fred's avatar fred

misc: fix check for permissions when removing an absence

parent e88c384e
......@@ -296,6 +296,7 @@ class EmissionAddAbsenceView(CreateView):
class AbsenceDeleteView(RedirectView):
def get_redirect_url(self, emission_slug, pk):
emission = Emission.objects.get(slug=emission_slug)
if not self.request.user.can_manage(emission):
raise PermissionDenied()
Absence.objects.filter(id=pk).delete()
......
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