Add user post deletion

Users can delete their posts as long as they don't clear their cookies,
and as long as server-side user sessions are persistent.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-07-13 21:28:07 -07:00
parent 96e8b7752f
commit a4f00e6242
5 changed files with 39 additions and 2 deletions

View File

@@ -124,6 +124,10 @@ class Post(models.Model):
# Image width and height
image_width = models.IntegerField(null=True, blank=True)
image_height = models.IntegerField(null=True, blank=True)
# The user token that was used to make this post. This is used for
# verification when a user wants to delete their post. It is not
# particularly secret and does not need to be hashed.
user_token = models.CharField(max_length=30, null=True)
class Meta:
permissions = [