Add post modify view

This allows moderators to modify posts (add sticky, etc).

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-06-30 16:21:36 -07:00
parent 2947ab6cf2
commit 6f99472f16
13 changed files with 124 additions and 22 deletions

View File

@@ -115,3 +115,17 @@ class BanForm(ModelForm):
else:
expires = None
self.instance.expires = expires
class PostModifyForm(ModelForm):
"""
A form used to modify the attributes of a post (sticky, locked, sink, etc)
"""
class Meta:
model = Post
fields = ["bump", "sticky"]
def clean(self):
super(PostModifyForm, self).clean()
print(self.fields["sticky"])