Esempio n. 1
0
def submit():

    pf = ProfanityFilter(no_word_boundaries=True)
    serial = request.form['serial']
    name = request.form['name']
    location = request.form['location']
    amount = request.form['amount']

    #Since this is an open text field accessible on a public website,
    #some form of profanity check is needed
    if pf.is_profane(name):
        return redirect("/warehouse")

    else:
        db = Database()
        db.addItem(serial, name, location, amount)
        return redirect("/warehouse")