I think you need to commit the session here, `db_session.commit()`, once you've added anything. Or you could do it in the request handler that calls this function, since we have an implicit `request <-> db session` relationship.