def clean_input():
    "\n    Make sure we're not getting bad data from the front end,\n    format data to be machine readable\n    "
    if empty(request.form.get('password', '')):
        abort(400)
    if empty(request.form.get('ttl', '')):
        abort(400)
    time_period = request.form['ttl'].lower()
    if (time_period not in TIME_CONVERSION):
        abort(400)
    return (TIME_CONVERSION[time_period], request.form['password'])
Make sure we're not getting bad data from the front end,
format data to be machine readable
def clean_input():
    "\n    Make sure we're not getting bad data from the front end,\n    format data to be machine readable\n    "
    if empty(request.form.get('password', )):
        abort(400)
    if empty(request.form.get('ttl', )):
        abort(400)
    time_period = request.form['ttl'].lower()
    if (time_period not in TIME_CONVERSION):
        abort(400)
    return (TIME_CONVERSION[time_period], request.form['password'])