Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@action.requires(lambda: True)
def index():
db.thing.insert(name="test")
session["number"] = session.get("number", 0) + 1
return "ok %s %s" % (session["number"], db(db.thing).count())
@action.requires(user_in(session))
@action.uses(db)
def todo():
return dict(id=db.todo.insert(info=request.json.get("info")))
@action.requires(user_in(session)) # then check we have a valid user in session
@action.uses(db) # all before starting a db connection
def todo():
return dict(items=db(db.todo).select(orderby=~db.todo.id).as_list())