Fix invalid redirect on unauthorized access to team app

pull/1/head
Luca 3 years ago
parent d6cb71f804
commit d52461205d

@ -14,7 +14,7 @@ def index(request):
pass pass
@login_required @login_required(login_url="/admin/login/")
def shift_overview(request): def shift_overview(request):
context = {} context = {}
context["running_shifts"] = [ context["running_shifts"] = [
@ -44,7 +44,7 @@ def add_helper_shift(self):
pass pass
@login_required() @login_required(login_url="/admin/login/")
def shift_detail(request, pk): def shift_detail(request, pk):
shift = get_object_or_404(Shift, pk=pk) shift = get_object_or_404(Shift, pk=pk)
form = HelperShift() form = HelperShift()
@ -75,11 +75,13 @@ def shift_detail(request, pk):
class HelperDetail(LoginRequiredMixin, DetailView): class HelperDetail(LoginRequiredMixin, DetailView):
login_url = "/admin/login/"
template_name = "helper_detail.html" template_name = "helper_detail.html"
model = Helper model = Helper
class ShiftList(LoginRequiredMixin, ListView): class ShiftList(LoginRequiredMixin, ListView):
login_url = "/admin/login/"
template_name = "shift_list.html" template_name = "shift_list.html"
model = Shift model = Shift
title = "Alle Schichten" title = "Alle Schichten"

Loading…
Cancel
Save