Uprava queries a dotazovani se pres base query builder, fix nahledu fotky pro editor, cache na fotky
This commit is contained in:
@@ -9,7 +9,8 @@ from utils.image import PhotoEditor
|
||||
|
||||
|
||||
class PhotoEditorEndpoint(AuthEndpoint):
|
||||
async def show_preview(self, photo_id: int, **kwargs):
|
||||
@staticmethod
|
||||
async def show_preview(photo_id: int, **kwargs):
|
||||
async with get_session() as db:
|
||||
photo = (await db.scalars(
|
||||
select(models.Photo)
|
||||
@@ -17,7 +18,7 @@ class PhotoEditorEndpoint(AuthEndpoint):
|
||||
)).one()
|
||||
|
||||
basepath = get_photo_basepath(photo.flight_id)
|
||||
filename = photo.filename
|
||||
filename = f"{photo.filename}.{photo.filename_extension}"
|
||||
|
||||
original_filename = '_original_' + filename
|
||||
if os.path.exists(f"{basepath}/{original_filename}"):
|
||||
|
||||
Reference in New Issue
Block a user