def login_view(self): form = LoginForm(request.form) if helpers.validate_form_on_submit(form): user = form.get_user() login.login_user(user) if isAdmin(): return redirect(url_for('.index')) self._template_args['form'] = form return super(MyAdminIndexView, self).index()
def is_accessible(self): return isAdmin()
def index(self): if not isAdmin(): return redirect(url_for('.login_view')) return super(MyAdminIndexView, self).index()