Merge branch 'main' of https://git.shevkunov.space/FascioSchool/FascioSchoolBot
This commit is contained in:
@@ -5,7 +5,10 @@ from app.infrastructure.database.crud import (
|
||||
get_event_by_id,
|
||||
get_events_list,
|
||||
)
|
||||
<<<<<<< HEAD
|
||||
from app.infrastructure.database.enums import UserEventStatus
|
||||
=======
|
||||
>>>>>>> 7e5939394de1e40064ccf364bcfabbbd117d5d32
|
||||
from app.infrastructure.database.models import Event
|
||||
|
||||
|
||||
@@ -34,3 +37,11 @@ async def registration_getter(dialog_manager: DialogManager, **kwargs):
|
||||
for ue in user.events
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
async def registraion_getter(dialog_manager: DialogManager, **kwargs):
|
||||
user = dialog_manager.middleware_data["user"]
|
||||
event_id = dialog_manager.dialog_data["selected_event"]
|
||||
return {
|
||||
"is_registered_to_event": any(ue.event_id == event_id for ue in user.events)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user