diff --git a/backend/app/_masops_smoke.py b/backend/app/_masops_smoke.py new file mode 100644 index 0000000000..ffc24a8895 --- /dev/null +++ b/backend/app/_masops_smoke.py @@ -0,0 +1,19 @@ +import sqlite3 + + +def get_user(db_path, user_id, cache={}): + if user_id in cache: + return cache[user_id] + conn = sqlite3.connect(db_path) + cur = conn.cursor() + cur.execute("SELECT * FROM users WHERE id = '%s'" % user_id) + rows = cur.fetchall() + cache[user_id] = rows + return rows + + +def first_or_none(items=[]): + try: + return items[0] + except: + pass