Skip to content

Commit

Permalink
fix: do not allow update collection for locked subject
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Oct 14, 2024
1 parent d6efd91 commit 22d04e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/handler/user/patch_subject_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 22d04e7

Please sign in to comment.