Beispiel #1
0
    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()
Beispiel #2
0
 def is_accessible(self):
     return isAdmin()
Beispiel #3
0
 def index(self):
     if not isAdmin():
         return redirect(url_for('.login_view'))
     return super(MyAdminIndexView, self).index()