From 21115979c46a0cdf2f93e25107472f04edd693d9 Mon Sep 17 00:00:00 2001 From: James W Thorne Date: Tue, 17 Jan 2017 17:44:47 -0600 Subject: [PATCH] Combine checks --- snappass/main.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/snappass/main.py b/snappass/main.py index c72a52b..b46a8bd 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -71,13 +71,10 @@ def clean_input(): Make sure we're not getting bad data from the front end, format data to be machine readable """ - if 'password' not in request.form: + if empty(request.form.get('password', '')): abort(400) - if not len(request.form['password']) > 0: - abort(400) - - if 'ttl' not in request.form: + if empty(request.form.get('ttl', '')): abort(400) time_period = request.form['ttl'].lower()