Ejemplo n.º 1
0
def login():
    form = LoginForm()
    if request.method == 'POST':
        if form.validate_on_submit():
            user, authenticated = User.authenticate(form.username.data,
                                                form.password.data)

            if user and authenticated:
                login_user(user, remember=form.remember_me.data)
                flash('Logged successfully %s' % current_user.username, 'success')
                return redirect(url_for('devices.devices_list'))

            flash("Wrong Username or Password.", "danger")
            print 'Wrong Username'
    return render_template('auth/login.html', title='Sign In', form=form)
Ejemplo n.º 2
0
def login():
    form = LoginForm()
    if request.method == 'POST':
        if form.validate_on_submit():
            user, authenticated = User.authenticate(form.username.data,
                                                    form.password.data)

            if user and authenticated:
                login_user(user, remember=form.remember_me.data)
                flash('Logged successfully %s' % current_user.username,
                      'success')
                return redirect(url_for('devices.devices_list'))

            flash("Wrong Username or Password.", "danger")
            print 'Wrong Username'
    return render_template('auth/login.html', title='Sign In', form=form)
Ejemplo n.º 3
0
    def save(self):

        return User.create_user(self.username.data, self.password.data)
Ejemplo n.º 4
0
    def save(self):

        return User.create_user(self.username.data, self.password.data)