ux: show when user is inactive

master
Serge Bazanski 2019-06-01 17:56:26 +02:00
parent 76cbbe83b2
commit f5c4c55f20
1 changed files with 5 additions and 1 deletions

View File

@ -318,8 +318,12 @@ def login():
if not check_credentials(username, password):
flash('Invalid username or password')
return render_template('login_oauth.html', form=form, next=next)
login_user(LDAPUserProxy(username), form.data['remember'])
user = LDAPUserProxy(username)
if not user.active:
flash('User inactive - have you paid your membership fees?')
return render_template('login_oauth.html', form=form, next=next)
login_user(user, form.data['remember'])
flash('Logged in successfully.')
return redirect(next or url_for('profile'))