diff --git a/plugins/cms_functions.py b/plugins/cms_functions.py index 7674bd0..557cd91 100644 --- a/plugins/cms_functions.py +++ b/plugins/cms_functions.py @@ -51,9 +51,9 @@ async def get_published_content(content_type, limit=10): "c.tags, c.body, cat.name as category_name " "FROM cms_content c " "LEFT JOIN cms_categories cat ON c.category_id = cat.id " - "WHERE c.content_type = %(ct)s AND c.status = 'published' " + "WHERE c.content_type = ${ct}$ AND c.status = 'published' " "ORDER BY c.sort_order, c.created_at DESC " - "LIMIT %(lim)s", + "LIMIT ${lim}$", {"ct": content_type, "lim": int(limit)} ) return list(rows) @@ -73,7 +73,7 @@ async def get_latest_news(limit=3): "LEFT JOIN cms_categories cat ON c.category_id = cat.id " "WHERE c.content_type = 'news' AND c.status = 'published' " "ORDER BY c.published_at DESC, c.created_at DESC " - "LIMIT %(lim)s", + "LIMIT ${lim}$", {"lim": int(limit)} ) return list(rows)