Fixed putting ann media src saving

This commit is contained in:
Dmitriy Shishkov 2023-08-11 17:27:01 +03:00
parent 8fb75f8329
commit 3bf00cea6a
Signed by: dm1sh
GPG Key ID: 027994B0AA357688

View File

@ -87,7 +87,7 @@ def put_in_db(name: Annotated[str, Form()], category: Annotated[str, Form()], be
temp_ancmt = models.Announcement(user_id=current_user.id, name=name, category=category, best_by=bestBy, temp_ancmt = models.Announcement(user_id=current_user.id, name=name, category=category, best_by=bestBy,
address=address, longtitude=longtitude, latitude=latitude, description=description, metro=metro, address=address, longtitude=longtitude, latitude=latitude, description=description, metro=metro,
trashId=trashId, booked_by=0) trashId=trashId, src=uploaded_name, booked_by=0)
db.add(temp_ancmt) # добавляем в бд db.add(temp_ancmt) # добавляем в бд
db.commit() # сохраняем изменения db.commit() # сохраняем изменения
db.refresh(temp_ancmt) # обновляем состояние объекта db.refresh(temp_ancmt) # обновляем состояние объекта