Add thread locking and permissions

Mods can lock threads from replying now. Yay!

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-07-08 21:55:25 -07:00
parent e866cbae0f
commit a3ebf75e83
4 changed files with 36 additions and 10 deletions

View File

@@ -93,8 +93,10 @@ class Post(models.Model):
ip = models.GenericIPAddressField()
# Capcode
capcode = models.ForeignKey("Capcode", null=True, blank=True, on_delete=SET_NULL)
# Post is stickied
# Post is stickied - it remains at the top of the bump list.
sticky = models.BooleanField(default=False, blank=True)
# Post is locked - nobody can post in it.
lock = models.BooleanField(default=False, blank=True)
# Creation time
created = models.DateTimeField(auto_now_add=True)
# Last bump time
@@ -122,6 +124,7 @@ class Post(models.Model):
permissions = [
("set_sticky", "Can sticky post"),
("set_bump", "Can bumplock post"),
("set_lock", "Can lock post"),
]
def save(self, *args, **kwargs):