aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dbstore/peewee_store.py')
-rw-r--r--dbstore/peewee_store.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/dbstore/peewee_store.py b/dbstore/peewee_store.py
index 3d37140..272e230 100644
--- a/dbstore/peewee_store.py
+++ b/dbstore/peewee_store.py
@@ -41,6 +41,15 @@ def get_user_by_state(state: str) -> dict:
41 return {} 41 return {}
42 42
43 43
44def get_user_access_key(telegram_user_id: str) -> str:
45 with db.connection_context():
46 try:
47 user = User.get(User.telegram_user_id == telegram_user_id)
48 return user.access_key
49 except DoesNotExist:
50 return ""
51
52
44class Location(BaseModel): 53class Location(BaseModel):
45 fsq_id = CharField(unique=True, primary_key=True) 54 fsq_id = CharField(unique=True, primary_key=True)
46 name = CharField(max_length=128) 55 name = CharField(max_length=128)
Powered by cgit v1.2.3 (git 2.41.0)