From a0d9b5ddf41b531336962c71a4b4e2a03872f51c Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 12 Feb 2018 22:17:46 -0600 Subject: [PATCH] Add generic 'login_as_home' setting i.e. redirect anonymous users to login instead of showing home page --- tailbone/views/common.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tailbone/views/common.py b/tailbone/views/common.py index 3cfaffa6..e5710f2b 100644 --- a/tailbone/views/common.py +++ b/tailbone/views/common.py @@ -69,6 +69,10 @@ class CommonView(View): """ Home page view. """ + if not mobile and not self.request.user: + if self.rattail_config.getbool('tailbone', 'login_is_home', default=True): + raise self.redirect(self.request.route_url('login')) + image_url = self.rattail_config.get( 'tailbone', 'main_image_url', default=self.request.static_url('tailbone:static/img/home_logo.png'))