diff --git a/board/forms.py b/board/forms.py index 55fef39..e7f7861 100644 --- a/board/forms.py +++ b/board/forms.py @@ -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 diff --git a/board/models.py b/board/models.py index fa70b24..5fa5968 100644 --- a/board/models.py +++ b/board/models.py @@ -119,7 +119,10 @@ class Post(models.Model): image_height = models.IntegerField(null=True) class Meta: - permissions = [("set_sticky", "Can sticky post")] + permissions = [ + ("set_sticky", "Can sticky post"), + ("set_bump", "Can bumplock post"), + ] def save(self, *args, **kwargs): if self.image: diff --git a/board/templates/board/post_modify_view.html b/board/templates/board/post_modify_view.html index fec8cbc..61bbd36 100644 --- a/board/templates/board/post_modify_view.html +++ b/board/templates/board/post_modify_view.html @@ -5,12 +5,7 @@