Convience redirect on .conf/checkin

Send voli's to the overview, and everyone else to what we want from
them.
This commit is contained in:
Sachi King 2018-01-20 20:23:09 +11:00
parent 8ee0dda5ac
commit f25f85f86e
2 changed files with 7 additions and 0 deletions

View file

@ -13,4 +13,5 @@ urlpatterns = [
url(r"^checkin/$", views.CheckInLanding.as_view(), name="check_in_scanner"),
url(r"^checkin/(?P<access_code>[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"),
]

View file

@ -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'))