feat: 每门课用独立会话学习,间隔改动即时生效,间隔为 0 时不显示倒计时
This commit is contained in:
@@ -463,14 +463,17 @@ def put_study_bundle(body: StudyBundleBody, request: Request, db: Session = Depe
|
||||
account = db.get(Account, _signed_in(request, db))
|
||||
if account is None:
|
||||
raise HTTPException(status_code=401, detail="未登录")
|
||||
workers_before = account.course_workers
|
||||
try:
|
||||
_apply_study_bundle(account, body)
|
||||
except HTTPException:
|
||||
db.rollback()
|
||||
raise
|
||||
db.commit()
|
||||
from euniv.autostudy import sync_work
|
||||
from euniv.autostudy import restart_work, sync_work
|
||||
|
||||
if account.course_workers != workers_before:
|
||||
restart_work(account.employee_id)
|
||||
sync_work(account.employee_id)
|
||||
payload = view_of(account)
|
||||
payload["monthly_target"] = account.monthly_target
|
||||
|
||||
Reference in New Issue
Block a user