feat: mlog_submit 时校验handle_date

This commit is contained in:
caoqianming 2024-07-18 14:48:55 +08:00
parent 9b3cbe75ae
commit 950b017073
1 changed files with 2 additions and 0 deletions

View File

@ -177,6 +177,8 @@ def mlog_submit(mlog: Mlog, user: User, now: Union[datetime.datetime, None]):
return
if now is None:
now = timezone.now()
if mlog.handle_date is None:
raise ParseError('请选择结束/操作时间')
if now.date() < mlog.handle_date:
raise ParseError('不可提交未来的日志')