コード例 #1
0
ファイル: auth.py プロジェクト: AAlvz/amonlite
    def get(self):

        errors = self.session.get('errors', None)
        form_data = self.session.get('form_data', None)

        # This page is active only when acl is enabled
        if self.acl == 'False':
            self.redirect('/')
        else:
            # This page is active only when there are no users in the system
            users = user_model.count_users()

            if users == 0:
                self.render('create_user.html', errors=errors, form_data=form_data)
            else:
                self.redirect('/login')
コード例 #2
0
    def get(self):

        errors = self.session.get('errors', None)
        form_data = self.session.get('form_data', None)

        # This page is active only when acl is enabled
        if self.acl == 'False':
            self.redirect('/')
        else:
            # This page is active only when there are no users in the system
            users = user_model.count_users()

            if users == 0:
                self.render('create_user.html',
                            errors=errors,
                            form_data=form_data)
            else:
                self.redirect('/login')
コード例 #3
0
ファイル: auth.py プロジェクト: AAlvz/amonlite
    def get(self):

        # Redirect if there are no users in the database
        users = user_model.count_users()
        if users == 0:
            self.redirect('/create_user')
        else:
            message =  self.session.get('message',None)
            errors =  self.session.get('errors',None)
            next = self.get_argument('next', None)
            
            try:
                del self.session['errors']
                del self.session['message']
            except:
                pass

            self.render('login.html', message=message, errors=errors, next=next)
コード例 #4
0
    def get(self):

        # Redirect if there are no users in the database
        users = user_model.count_users()
        if users == 0:
            self.redirect('/create_user')
        else:
            message = self.session.get('message', None)
            errors = self.session.get('errors', None)
            next = self.get_argument('next', None)

            try:
                del self.session['errors']
                del self.session['message']
            except:
                pass

            self.render('login.html',
                        message=message,
                        errors=errors,
                        next=next)