From 7c5c8f6ac791a5a73e777a732bcac2fcb1fed963 Mon Sep 17 00:00:00 2001 From: Jeppe Ernst Date: Thu, 28 Dec 2017 21:37:34 +0100 Subject: [PATCH] require 2fa for /admin pages if the user has enabled 2fa --- src/bornhack/urls.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bornhack/urls.py b/src/bornhack/urls.py index 0746bed2..da7583ee 100644 --- a/src/bornhack/urls.py +++ b/src/bornhack/urls.py @@ -5,6 +5,7 @@ from allauth.account.views import ( from django.conf import settings from django.conf.urls import include, url from django.contrib import admin +from django.contrib.auth.decorators import login_required from camps.views import * from info.views import * from villages.views import * @@ -15,6 +16,8 @@ from people.views import * from tickets.views import ShopTicketListView from bar.views import MenuView +admin.site.login = login_required(admin.site.login) + urlpatterns = [ url( r'^profile/',