fix(fastapi): adds proper check for null json for postgresql
This commit is contained in:
parent
9cb7d9f432
commit
144bfcfe1a
1 changed files with 4 additions and 2 deletions
|
|
@ -5,7 +5,7 @@ import random
|
|||
from typing import Annotated, List, Literal, Optional
|
||||
from fastapi import APIRouter, Body, Depends, File, HTTPException, UploadFile
|
||||
from fastapi.responses import StreamingResponse
|
||||
from sqlalchemy import delete
|
||||
from sqlalchemy import String, cast, delete, text
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlmodel import select
|
||||
from constants.documents import UPLOAD_ACCEPTED_FILE_TYPES
|
||||
|
|
@ -82,7 +82,9 @@ async def delete_presentation(
|
|||
async def get_all_presentations(sql_session: AsyncSession = Depends(get_async_session)):
|
||||
presentations_with_slides = []
|
||||
presentations = await sql_session.scalars(
|
||||
select(PresentationModel).where(PresentationModel.layout != "null")
|
||||
select(PresentationModel).where(
|
||||
cast(PresentationModel.layout, String) != "null"
|
||||
)
|
||||
)
|
||||
|
||||
async def inner(presentation: PresentationModel, sql_session: AsyncSession):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue