Skip to content
Browse files

slight change to handle user not loged in

  • Loading branch information...
1 parent 54d34d0 commit d6f598a49ccac9f124223dd805b3748efbff873f @drewverlee committed
Showing with 5 additions and 2 deletions.
  1. +5 −2 petalapp/views.py
View
7 petalapp/views.py
@@ -71,14 +71,17 @@ def index():
@app.route('/login')
def login():
+ #TODO refactor please :(
if g.user.is_active():
perm1 = Permission(RoleNeed(g.user.role))
identity_changed.send(app, identity=Identity(g.user.role))
+ rolelevel= g.user.role
session['logged_in'] = True
#TODO add some flashing
else:
- perm1= None # to represent no level aka Anonymous
- return render_template('login.html', perm1=perm1,level=g.user.role)
+ perm1 = Permission(RoleNeed(g.user)) # to represent no level aka Anonymous
+ rolelevel = None
+ return render_template('login.html', perm1=perm1,level=rolelevel)
@app.route('/logout')

0 comments on commit d6f598a

Please sign in to comment.
Something went wrong with that request. Please try again.