diff --git a/src/user/views/contribution_views.py b/src/user/views/contribution_views.py index 6cddba511..8dff84163 100644 --- a/src/user/views/contribution_views.py +++ b/src/user/views/contribution_views.py @@ -42,6 +42,7 @@ def _get_latest_actions(self, author_id: str = None): actions = ( self.get_filtered_queryset() .exclude(Q(is_removed=True) | Q(display=False)) + .exclude(user__is_active=False) .filter( user__isnull=False, content_type__model__in=self._get_allowed_models(), diff --git a/src/user/views/user_views.py b/src/user/views/user_views.py index 8bffa85ad..5705c2eea 100644 --- a/src/user/views/user_views.py +++ b/src/user/views/user_views.py @@ -163,6 +163,8 @@ def censor(self, request, pk=None): user_to_censor = User.objects.get(author_profile__id=author_id) user_to_censor.set_probable_spammer() user_to_censor.set_suspended() + user_to_censor.is_active = False + user_to_censor.save() handle_spam_user_task(user_to_censor.id, request.user) return Response({"message": "User is Censored"}, status=200) @@ -746,6 +748,7 @@ def has_seen_stripe_modal(self, request): def reinstate(self, request): author_id = request.data["author_id"] user = Author.objects.get(id=author_id).user + user.is_active = True user.is_suspended = False user.probable_spammer = False user.save() @@ -791,6 +794,9 @@ def sift_check_user_content(self, request): f"Suspending User - {user.id}: {user.first_name} {user.last_name} - {decision_id}" ) user.set_suspended(is_manual=False) + user.is_active = False + user.save() + serialized = UserSerializer(user) return Response(serialized.data, status=200) else: