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 e231f687 authored by Mathis Dedial's avatar Mathis Dedial
Browse files

Add server-side validation for maximum # of toppings (shame on me)

parent 16cc44f1
Pipeline #2743 skipped with stage
......@@ -97,6 +97,11 @@ def login():
return redirect(url_for('index'))
if request.method == 'POST':
# Login in debug mode for testing
if 'DEBUG' in app.config and app.config['DEBUG']:
session['user'] = app.config['LDAP_TEST_USER']
return redirect(url_for('index'))
user = request.form['user']
passwd = request.form['passwd']
# Attempt to log in using LDAP
......@@ -149,6 +154,8 @@ def create():
toppings = request.form.getlist('toppings')
if not toppings:
return die('Please select at least one topping for your burger.')
if len(toppings) > 6:
return die('Please select at most six toppings for your burger.')
side = request.form.get('side')
if not side:
......
......@@ -11,8 +11,6 @@ lazy-object-proxy==1.3.1
ldap3==2.4.1
MarkupSafe==1.0
mccabe==0.6.1
nethz==1.0
pkg-resources==0.0.0
pyasn1==0.4.2
pyldap==2.4.45
pylint==1.8.2
......@@ -21,3 +19,4 @@ six==1.11.0
SQLAlchemy==1.2.3
Werkzeug==0.14.1
wrapt==1.10.11
-e git+https://github.com/NotSpecial/nethz.git#egg=nethz
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