forked from retoor/devplacepy
feat: add backup CLI commands, AI correction/modifier services, and timezone-aware date display
- Add `devplace backups` CLI subcommands (list, run, prune, clear) with job enqueueing and orphan cleanup - Introduce `BACKUPS_DIR` and `BACKUP_STAGING_DIR` config paths for backup storage - Implement `schedule_correction` and `schedule_modification` calls in content creation, comment creation, and comment editing flows - Add `DEFAULT_CORRECTION_PROMPT` and `DEFAULT_MODIFIER_PROMPT` config constants for AI content processing - Document timezone-aware date display using `local_dt`/`dt_ago` Jinja globals with client-side `Intl` localization - Update README with AI content correction/modifier support in direct messages via `@ai` inline instructions - Add `track_action(user["uid"], "vote")` call on upvote in `apply_vote`
This commit is contained in:
@@ -14,6 +14,8 @@ from devplacepy.database import (
|
||||
)
|
||||
from devplacepy.content import apply_vote, delete_comment_record, is_owner, is_admin
|
||||
from devplacepy.services.audit import record as audit
|
||||
from devplacepy.services.correction import schedule_correction
|
||||
from devplacepy.services.ai_modifier import schedule_modification
|
||||
from devplacepy.services.devrant.params import merge_params
|
||||
from devplacepy.services.devrant.tokens import resolve_user
|
||||
from devplacepy.services.devrant.ids import as_int, comment_by_id
|
||||
@@ -77,6 +79,8 @@ async def edit_comment(request: Request, comment_id: str):
|
||||
},
|
||||
["uid"],
|
||||
)
|
||||
schedule_correction(user, "comments", comment["uid"], request)
|
||||
schedule_modification(user, "comments", comment["uid"], request)
|
||||
audit.record(
|
||||
request,
|
||||
"comment.edit",
|
||||
|
||||
@@ -18,6 +18,8 @@ from devplacepy.content import (
|
||||
is_admin,
|
||||
)
|
||||
from devplacepy.services.audit import record as audit
|
||||
from devplacepy.services.correction import schedule_correction
|
||||
from devplacepy.services.ai_modifier import schedule_modification
|
||||
from devplacepy.services.devrant.params import merge_params
|
||||
from devplacepy.services.devrant.tokens import resolve_user
|
||||
from devplacepy.services.devrant.ids import as_int, post_by_id
|
||||
@@ -143,6 +145,8 @@ async def edit_rant(request: Request, rant_id: str):
|
||||
},
|
||||
["uid"],
|
||||
)
|
||||
schedule_correction(user, "posts", post["uid"], request)
|
||||
schedule_modification(user, "posts", post["uid"], request)
|
||||
audit.record(
|
||||
request,
|
||||
"post.edit",
|
||||
|
||||
Reference in New Issue
Block a user