diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-12-14 18:43:03 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-12-14 18:43:03 +0100 |
commit | c36736997b7c0a0e6cc2cbb426f49b486b78a171 (patch) | |
tree | f9588cac0b9f931dfbe733d49eb68ded9f602587 /module/web/setup_app.py | |
parent | merge setup to default (diff) | |
download | pyload-c36736997b7c0a0e6cc2cbb426f49b486b78a171.tar.xz |
cleaned setup
Diffstat (limited to 'module/web/setup_app.py')
-rw-r--r-- | module/web/setup_app.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/module/web/setup_app.py b/module/web/setup_app.py index 055cb2a81..68da474bb 100644 --- a/module/web/setup_app.py +++ b/module/web/setup_app.py @@ -1,13 +1,24 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from bottle import route, request, response, HTTPError +from bottle import route, request, response, HTTPError, redirect from webinterface import PROJECT_DIR, SETUP, env from utils import render_to_response +def setup_required(func): + def _view(*args, **kwargs): + + # setup needs to be running + if SETUP is None: + redirect("/nopermission") + + return func(*args, **kwargs) + return _view + @route("/setup") +@setup_required def setup(): return render_to_response('setup.html') |