Commit 5932aad9 authored by Krophil's avatar Krophil

Improve journal removing

parent 5f9ec9a2
Pipeline #793 passed with stage
in 3 minutes and 41 seconds
......@@ -239,6 +239,12 @@ class JournalDeleteView(CanEditPropMixin, DeleteView):
template_name = 'core/delete_confirm.jinja'
success_url = reverse_lazy('accounting:club_details')
def dispatch(self, request, *args, **kwargs):
self.object = self.get_object()
if self.object.operations.count() == 0:
return super(JournalDeleteView, self).dispatch(request, *args, **kwargs)
else:
raise PermissionDenied
# Operation views
......
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