Update wipe to check user token as well as user IP

Wiping is done via a single user post. It will search for all posts by
that IP address *or* user token and delete them.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-07-17 17:02:51 -07:00
parent 1856adaf3b
commit 0b0c0fe603

View File

@@ -288,7 +288,9 @@ class PostWipeView(PermissionRequiredMixin, detail.SingleObjectMixin, TemplateVi
@property @property
def all_posts(self): def all_posts(self):
return Post.objects.filter(ip=self.object.ip) return Post.objects.filter(
Q(ip=self.object.ip) | Q(user_token=self.object.user_token)
)
def dispatch(self, request, *args, **kwargs): def dispatch(self, request, *args, **kwargs):
self.object = self.get_object() self.object = self.get_object()