I have a Flask view that accepts a url parameter old_del, which can only accept 3 values: 'comma', 'pipe', and 'tab'.
@app.route('/jobs/change-file-del/<str:file_location>/<str:old_del>')
def process_feed(file_location, old_del='tab'):
...
I want to return an error if the user includes an invalid value for old_del. I can accomplish this using an assert statement, but is there a way to do this specifically with Flask?
if old_del not in { 'comma', 'pipe', 'tab'}: ...