trying to convert bulletin to new db system.
This commit is contained in:
@@ -5,6 +5,7 @@ from pydantic import BaseModel, Field, constr
|
||||
from datetime import datetime
|
||||
import transaction
|
||||
from persistent.list import PersistentList
|
||||
from ZODB.Connection import Connection
|
||||
|
||||
from ..database import DbDependency, TransactionDependency
|
||||
from ..dependencies import get_current_http_user
|
||||
@@ -21,9 +22,8 @@ html_router = APIRouter(tags=["bulletins-html"])
|
||||
|
||||
# --- API Endpoints ---
|
||||
|
||||
async def list_bulletins(, limit: int = 50, since: Optional[datetime] = None) -> dict:
|
||||
with trans as conn:
|
||||
root = conn.root()
|
||||
async def list_bulletins(connection: Connection, limit: int = 50, since: Optional[datetime] = None) -> dict:
|
||||
root = connection.root()
|
||||
bulletins_list: List[Bulletin] = root.get("bulletins", [])
|
||||
|
||||
# Newest first
|
||||
|
||||
Reference in New Issue
Block a user