To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 1b6d13d2 authored by Mathis Dedial's avatar Mathis Dedial
Browse files

Enable LDAP login checks

parent 42a38ec7
Pipeline #2715 skipped with stage
......@@ -15,7 +15,6 @@ def index():
'''
# Fetch list of burgers with corresponding vote info
# Could probably also be done with SQLAlchemy but too lazy to look up how
# TODO: Query has a bug. Only burgers created by the user himself are returned.
querystring = text('SELECT burger.id AS id, name, description, burger.nethz AS nethz, timestamp, '
'bread, patty, toppings, side, COUNT(vote_1.id) as vote_count, vote_2.id as vote_id '
'FROM burger '
......@@ -33,7 +32,7 @@ def index():
@app.route('/vote', methods=['POST'])
# @ldap.login_required
@ldap.login_required
def vote():
'''
Handles POST requests for voting
......@@ -80,18 +79,18 @@ def vote():
return redirect(url_for('index'))
# @app.before_request
# def load_user():
# '''
# Load user data before any request processing
# '''
# try:
# if session['nethz']:
# g.user = session['nethz']
# return
# except KeyError:
# pass
# g.user = None
@app.before_request
def load_user():
'''
Load user data before any request processing
'''
try:
if session['nethz']:
g.user = session['nethz']
return
except KeyError:
pass
g.user = None
@app.route('/login', methods=['GET', 'POST'])
......@@ -125,7 +124,7 @@ def logout():
@app.route('/new', methods=['GET', 'POST'])
# @ldap.login_required
@ldap.login_required
def create():
'''
Burger creator
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment