From 22d04e74cb2809aaa9f6eee911e799158d836baa Mon Sep 17 00:00:00 2001 From: Trim21 Date: Tue, 15 Oct 2024 00:20:47 +0800 Subject: [PATCH] fix: do not allow update collection for locked subject --- web/handler/user/patch_subject_collection.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/handler/user/patch_subject_collection.go b/web/handler/user/patch_subject_collection.go index 56f196edb..e410eeef7 100644 --- a/web/handler/user/patch_subject_collection.go +++ b/web/handler/user/patch_subject_collection.go @@ -84,6 +84,10 @@ func (h User) updateOrCreateSubjectCollection( return errgo.Wrap(err, "query.GetSubject") } + if s.Locked() { + return res.NotFound("subject locked") + } + if s.TypeID != model.SubjectTypeBook { if r.VolStatus.Set || r.EpStatus.Set { return res.BadRequest("can't set 'vol_status' or 'ep_status' on non-book subject")