This commit is contained in:
Valentin CZERYBA 2024-12-22 22:26:09 +01:00
parent 94bcc9ee5b
commit c3fe5dad79

View File

@ -351,10 +351,10 @@ async def update_events(authorize: Annotated[bool, Depends(permissions_checker.P
event.longitude = eventSingle.longitude event.longitude = eventSingle.longitude
event.imgUrl = eventSingle.imgUrl event.imgUrl = eventSingle.imgUrl
event.tags = eventSingle.tags event.tags = eventSingle.tags
for tag_name in eventSingle: for tag_name in eventSingle.tags:
tag = tags_repository.find_one_by({"name": {'$eq': tag_name}}) tag = tags_repository.find_one_by({"name": {'$eq': tag_name}})
if tag is None: if tag is None:
tag = Tags(name=tag_name) tag = tags.Tags(name=tag_name)
tags_repository.save(tag) tags_repository.save(tag)
event.status = 1 event.status = 1
event.created_at = datetime.today() event.created_at = datetime.today()