Combine checks

This commit is contained in:
James W Thorne 2017-01-17 17:44:47 -06:00
parent d9973c3f29
commit 21115979c4

View file

@ -71,13 +71,10 @@ def clean_input():
Make sure we're not getting bad data from the front end, Make sure we're not getting bad data from the front end,
format data to be machine readable format data to be machine readable
""" """
if 'password' not in request.form: if empty(request.form.get('password', '')):
abort(400) abort(400)
if not len(request.form['password']) > 0: if empty(request.form.get('ttl', '')):
abort(400)
if 'ttl' not in request.form:
abort(400) abort(400)
time_period = request.form['ttl'].lower() time_period = request.form['ttl'].lower()