mirror of
https://git.ari.lt/ari.lt/blog.ari.lt.git
synced 2025-02-04 09:39:25 +01:00
update @ Tue Mar 19 01:57:53 EET 2024
Signed-off-by: Ari Archer <ari@ari.lt>
This commit is contained in:
parent
d614f24de9
commit
c2bf20c7b1
1 changed files with 9 additions and 2 deletions
|
@ -858,7 +858,7 @@ created : {format_time(post["created"])}"""
|
|||
|
||||
|
||||
@cmds.new
|
||||
def ed(config: dict[str, typing.Any]) -> int:
|
||||
def ed(config: dict[str, typing.Any], major: bool = True) -> int:
|
||||
"""edit posts"""
|
||||
|
||||
fields: list[str] = select_multi(tuple(ecmds.commands.keys()))
|
||||
|
@ -882,11 +882,18 @@ def ed(config: dict[str, typing.Any]) -> int:
|
|||
if code is not OK:
|
||||
return code
|
||||
|
||||
post["edited"] = datetime.datetime.utcnow().timestamp()
|
||||
if major:
|
||||
post["edited"] = datetime.datetime.utcnow().timestamp()
|
||||
|
||||
return OK
|
||||
|
||||
|
||||
@cmds.new
|
||||
def med(config: dict[str, typing.Any]) -> int:
|
||||
"""minor edit posts"""
|
||||
return ed(config=config, major=False) # type: ignore
|
||||
|
||||
|
||||
@cmds.new
|
||||
def rm(config: dict[str, typing.Any]) -> int:
|
||||
"""remove posts"""
|
||||
|
|
Loading…
Add table
Reference in a new issue