Compare commits
No commits in common. "3c851c8e8fe142867a7bd659b3ad8a90d6565de5" and "434f553ce4da62d92bc4d5375227543f6e89d084" have entirely different histories.
3c851c8e8f
...
434f553ce4
@ -18,12 +18,13 @@ def create_indexes():
|
||||
database.get_collection('configs').create_index([
|
||||
('stage', 1),
|
||||
('project', 1),
|
||||
('name', 1),
|
||||
], unique=True)
|
||||
('name', 1)
|
||||
])
|
||||
database.get_collection('experiments').create_index([
|
||||
('stage', 1),
|
||||
('project', 1),
|
||||
], unique=True)
|
||||
('name', 1)
|
||||
])
|
||||
database.get_collection('staff').create_index([
|
||||
('platform_id', 1),
|
||||
], unique=True)
|
||||
])
|
||||
|
@ -13,7 +13,6 @@ class Staff(pydantic.BaseModel):
|
||||
yandex_id: int|None = None
|
||||
telegram_id: int|None = None
|
||||
email: str|None = None
|
||||
telegram_username: str|None = None
|
||||
|
||||
|
||||
async def create(staff: Staff) -> str:
|
||||
@ -21,8 +20,8 @@ async def create(staff: Staff) -> str:
|
||||
return result.inserted_id
|
||||
|
||||
|
||||
async def update(platform_id: int, vk_id: int|None, yandex_id: int|None, telegram_id: int|None, email: str|None, telegram_username: str|None) -> bool:
|
||||
result = await collection.update_one({'platform_id': platform_id}, {'$set': {'vk_id': vk_id, 'yandex_id': yandex_id, 'telegram_id': telegram_id, 'email': email, 'telegram_username': telegram_username}})
|
||||
async def update(platform_id: int, vk_id: int|None, yandex_id: int|None, telegram_id: int|None, email: str|None) -> bool:
|
||||
result = await collection.update_one({'platform_id': platform_id}, {'$set': {'vk_id': vk_id, 'yandex_id': yandex_id, 'telegram_id': telegram_id, 'email': email}})
|
||||
return result.modified_count != 0
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user