Commit c4d00c5f authored by fred's avatar fred

don't require special delete_absence permission to delete

parent e8f99fdb
...@@ -295,7 +295,7 @@ class EmissionAddAbsenceView(CreateView): ...@@ -295,7 +295,7 @@ class EmissionAddAbsenceView(CreateView):
class AbsenceDeleteView(RedirectView): class AbsenceDeleteView(RedirectView):
def get_redirect_url(self, emission_slug, pk): def get_redirect_url(self, emission_slug, pk):
if not self.request.user.has_perm('emissions.delete_absence'): if not self.request.user.can_manage(emission):
raise PermissionDenied() raise PermissionDenied()
Absence.objects.filter(id=pk).delete() Absence.objects.filter(id=pk).delete()
messages.success(self.request, SUCCESS_MESSAGE) messages.success(self.request, SUCCESS_MESSAGE)
......
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