fix events
This commit is contained in:
parent
322c00e18d
commit
e7d13bda96
@ -155,7 +155,7 @@ async def update_events(authorize: Annotated[bool, Depends(permissions_checker.P
|
|||||||
status_code=status.HTTP_400_BAD_REQUEST,
|
status_code=status.HTTP_400_BAD_REQUEST,
|
||||||
detail="Body request is empty"
|
detail="Body request is empty"
|
||||||
)
|
)
|
||||||
event_repository = event.EventRepository(database=database.database)
|
event_repository = events.EventRepository(database=database.database)
|
||||||
|
|
||||||
event = event_repository.find_one_by({"name": {'$eq': eventSingle.name}})
|
event = event_repository.find_one_by({"name": {'$eq': eventSingle.name}})
|
||||||
if event is not None:
|
if event is not None:
|
||||||
@ -165,7 +165,7 @@ async def update_events(authorize: Annotated[bool, Depends(permissions_checker.P
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
event = events.Event(name=eventSingle.name, place=eventSigle.place)
|
event = events.Event(name=eventSingle.name, place=eventSingle.place)
|
||||||
event.start_date = eventSingle.start_date
|
event.start_date = eventSingle.start_date
|
||||||
event.end_date = eventSingle.end_date
|
event.end_date = eventSingle.end_date
|
||||||
event.created_at = datetime.today()
|
event.created_at = datetime.today()
|
||||||
@ -210,7 +210,7 @@ async def patch_events_groups(authorize: Annotated[bool, Depends(permissions_che
|
|||||||
detail="eventids should be greater than 0"
|
detail="eventids should be greater than 0"
|
||||||
)
|
)
|
||||||
|
|
||||||
event_repository = users.EventRepository(database=database.database)
|
event_repository = events.EventRepository(database=database.database)
|
||||||
content = {"message": "events are enabled"}
|
content = {"message": "events are enabled"}
|
||||||
for i in eventids.ids:
|
for i in eventids.ids:
|
||||||
event = event_repository.find_one_by_id(ObjectId(i))
|
event = event_repository.find_one_by_id(ObjectId(i))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user