Add bumplock to post modify form, and add set_bump permission
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -127,7 +127,7 @@ class PostModifyForm(ModelForm):
|
||||
model = Post
|
||||
# we specify fields up here too because otherwise they won't be
|
||||
# recognized by the form to update values
|
||||
fields: list[str] = ["sticky"]
|
||||
fields = ["sticky", "bump"]
|
||||
|
||||
def __init__(self, *args, user, **kwargs):
|
||||
super(PostModifyForm, self).__init__(*args, **kwargs)
|
||||
@@ -135,6 +135,8 @@ class PostModifyForm(ModelForm):
|
||||
fields = []
|
||||
if self.user.has_perm("board.set_sticky"):
|
||||
fields += ["sticky"]
|
||||
if self.user.has_perm("board.set_bump"):
|
||||
fields += ["bump"]
|
||||
# NOTE:
|
||||
# We do *not* need to check permissions against these fields we're
|
||||
# setting down here in the self.clean() function in the case that a
|
||||
|
||||
Reference in New Issue
Block a user