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:
@@ -288,7 +288,9 @@ class PostWipeView(PermissionRequiredMixin, detail.SingleObjectMixin, TemplateVi
|
||||
|
||||
@property
|
||||
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):
|
||||
self.object = self.get_object()
|
||||
|
||||
Reference in New Issue
Block a user