fix tags #38

Merged
v4l3n71n merged 1 commits from hotfix/fix-tags-put into master 2024-12-22 21:28:17 +00:00

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()