git.haldean.org apex / 56b7c15
maintain user list in apex:users Haldean Brown 8 months ago
1 changed file(s) with 3 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
4141 return None
4242
4343 def set_session_user(username):
44 r.sadd("apex:users", username)
4445 flask.session["username"] = username
4546
4647 def user_is_admin(username=None):
4748 if username is None:
4849 username = session_user()
49 if username is None:
50 return False
50 if username is None:
51 return False
5152 return bool(r.get("apex:users:{}:admin".format(username)))
5253
5354 def user_set_admin(username):