Render markdown in gist and project sidebar titles; add content visibility and GIF picker
DevPlace CI / test (push) Failing after 1h5m29s
DevPlace CI / test (push) Failing after 1h5m29s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ from typing import Optional
|
||||
from devplacepy.attachments import get_attachments_batch
|
||||
from devplacepy.database import (
|
||||
get_table,
|
||||
listed_clause,
|
||||
get_users_by_uids,
|
||||
get_user_votes,
|
||||
get_vote_counts,
|
||||
@@ -49,9 +50,15 @@ def build_rant_list(posts: list, viewer: Optional[dict]) -> list:
|
||||
|
||||
def list_rants(sort: str, limit: int, skip: int, viewer: Optional[dict]) -> list:
|
||||
order = SORT_ORDER.get(sort, SORT_ORDER["recent"])
|
||||
posts_table = get_table("posts")
|
||||
listed = listed_clause(posts_table)
|
||||
posts = list(
|
||||
get_table("posts").find(
|
||||
deleted_at=None, order_by=order, _limit=limit, _offset=skip
|
||||
posts_table.find(
|
||||
*([listed] if listed is not None else []),
|
||||
deleted_at=None,
|
||||
order_by=order,
|
||||
_limit=limit,
|
||||
_offset=skip,
|
||||
)
|
||||
)
|
||||
return build_rant_list(posts, viewer)
|
||||
@@ -64,9 +71,14 @@ def search_rants(term: str, viewer: Optional[dict], limit: int = 50) -> list:
|
||||
)
|
||||
if clause is None:
|
||||
return []
|
||||
listed = listed_clause(posts_table)
|
||||
posts = list(
|
||||
posts_table.find(
|
||||
clause, deleted_at=None, order_by=["-created_at"], _limit=limit
|
||||
clause,
|
||||
*([listed] if listed is not None else []),
|
||||
deleted_at=None,
|
||||
order_by=["-created_at"],
|
||||
_limit=limit,
|
||||
)
|
||||
)
|
||||
return build_rant_list(posts, viewer)
|
||||
|
||||
Reference in New Issue
Block a user