Add board locking, update tests, and update clean() methods

* Boards can be locked from allowing posts - this is can be useful for
  things like archived boards or locking down in the event of an
  emergency
* Some validation checks for new posts are from the reply/thread form to
  the Post model's clean() method
* Add some new tests, I've really been falling behind on those

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-07-12 18:30:16 -07:00
parent 250ebe2b84
commit d3e1f5a978
3 changed files with 70 additions and 6 deletions

View File

@@ -68,8 +68,6 @@ class ReplyForm(PostForm):
def clean(self):
super().clean()
if self.instance.op.lock:
raise ValidationError(_("This thread is locked, you cannot reply to it"))
capcode = self.cleaned_data["capcode"]
if capcode:
if not self.user or not self.user.has_perm("board.use_capcode", capcode):