From f25f85f86eeddaa32167e45f5bd748944a9124d0 Mon Sep 17 00:00:00 2001 From: Sachi King Date: Sat, 20 Jan 2018 20:23:09 +1100 Subject: [PATCH] Convience redirect on .conf/checkin Send voli's to the overview, and everyone else to what we want from them. --- vendor/regidesk/regidesk/urls.py | 1 + vendor/regidesk/regidesk/views.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/vendor/regidesk/regidesk/urls.py b/vendor/regidesk/regidesk/urls.py index 8aa1e555..0782e5a6 100644 --- a/vendor/regidesk/regidesk/urls.py +++ b/vendor/regidesk/regidesk/urls.py @@ -13,4 +13,5 @@ urlpatterns = [ url(r"^checkin/$", views.CheckInLanding.as_view(), name="check_in_scanner"), url(r"^checkin/(?P[A-Z0-9]{6})/$", views.check_in_overview, name="check_in_user_view"), url(r"^checkin/([A-Z0-9]{6})/badge$", views.checken_in_badge, name="check_in_badge"), + url(r"^/?$", views.redir_main, name="checkin_choose"), ] diff --git a/vendor/regidesk/regidesk/views.py b/vendor/regidesk/regidesk/views.py index b2805046..e9cca5a9 100644 --- a/vendor/regidesk/regidesk/views.py +++ b/vendor/regidesk/regidesk/views.py @@ -326,3 +326,9 @@ def checken_in_badge(request, access_code): return render(request, "regidesk/ci_code_404.html", {}) badge = render_badge(check_in[0].user, format="svg", overlay=True) return badge + +@login_required +def redir_main(request): + if request.user.has_perm('regidesk.view_boarding_pass'): + return redirect(reverse('regidesk:boarding_overview')) + return redirect(reverse('regidesk:boardingpass'))