Compare commits
No commits in common. "5a263f169e9a362d1c2adbcc80e47c09f8619fc1" and "43c6aad6651d6b897556f46da4a5cfad98ceb445" have entirely different histories.
5a263f169e
...
43c6aad665
@ -18,12 +18,11 @@ def create_indexes():
|
|||||||
database.get_collection('configs').create_index([
|
database.get_collection('configs').create_index([
|
||||||
('stage', 1),
|
('stage', 1),
|
||||||
('project', 1),
|
('project', 1),
|
||||||
('name', 1),
|
])
|
||||||
], unique=True)
|
|
||||||
database.get_collection('experiments').create_index([
|
database.get_collection('experiments').create_index([
|
||||||
('stage', 1),
|
('stage', 1),
|
||||||
('project', 1),
|
('project', 1),
|
||||||
], unique=True)
|
])
|
||||||
database.get_collection('staff').create_index([
|
database.get_collection('staff').create_index([
|
||||||
('platform_id', 1),
|
('platform_id', 1),
|
||||||
], unique=True)
|
])
|
||||||
|
@ -13,7 +13,6 @@ class Staff(pydantic.BaseModel):
|
|||||||
yandex_id: int|None = None
|
yandex_id: int|None = None
|
||||||
telegram_id: int|None = None
|
telegram_id: int|None = None
|
||||||
email: str|None = None
|
email: str|None = None
|
||||||
telegram_username: str|None = None
|
|
||||||
|
|
||||||
|
|
||||||
async def create(staff: Staff) -> str:
|
async def create(staff: Staff) -> str:
|
||||||
@ -21,8 +20,8 @@ async def create(staff: Staff) -> str:
|
|||||||
return result.inserted_id
|
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:
|
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, 'telegram_username': telegram_username}})
|
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
|
return result.modified_count != 0
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user