diff --git a/STATE.md b/STATE.md index a059cb1..811af0f 100644 --- a/STATE.md +++ b/STATE.md @@ -100,8 +100,9 @@ canonical git repository as FN-8. Code work for both projects must happen in - The editor textarea must show only clean editable text. - The list preview in `/editor` should show the publication preview, including composed hashtags. - `build_publication_text()` in `src/vk_parser_app/text_utils.py` is display/composition helper only. Do not use it before writing `final_text` to DB. -- `/raw` has a manual checkbox action to send rejected posts back to rewrite. - It resets stale rewrite/final fields and sets `rewrite_status='pending'`. +- `/raw` has a manual checkbox action to send AI-rejected posts back to + rewrite. It is intentionally limited to `qualification_status='rejected'`; + editor-rejected posts that were AI-accepted are not selectable there. - VK/MAX successful publications also sync `raw_posts.publication_status` and `editorial_status` to `published`; this keeps VK-only projects from leaving posts forever in the editor's accepted tab. diff --git a/src/vk_parser_app/admin.py b/src/vk_parser_app/admin.py index be906a6..b0163f7 100644 --- a/src/vk_parser_app/admin.py +++ b/src/vk_parser_app/admin.py @@ -1125,10 +1125,7 @@ def prepare_raw_post(row: Any) -> dict[str, Any]: post["ai_badge"] = ai_badge(post) post["can_send_to_rewrite"] = ( post.get("status") == "storage_ready" - and ( - (post.get("qualification_status") or "pending") == "rejected" - or (post.get("editorial_status") or "review") == "rejected" - ) + and (post.get("qualification_status") or "pending") == "rejected" ) return post @@ -2733,10 +2730,7 @@ async def raw_send_to_rewrite( FROM raw_posts WHERE id=ANY($1::bigint[]) AND status='storage_ready' - AND ( - COALESCE(qualification_status, 'pending')='rejected' - OR COALESCE(editorial_status, 'review')='rejected' - ) + AND COALESCE(qualification_status, 'pending')='rejected' FOR UPDATE ) UPDATE raw_posts rp