From 4b846478ae396e7f060e094e3a7901bf658fe040 Mon Sep 17 00:00:00 2001 From: bluebamus Date: Tue, 8 Aug 2023 00:34:45 +0900 Subject: [PATCH] bug fix at index. deleted blog post was showing up. --- home/views/index.py | 8 ++++---- users/views/users_forms.py | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/home/views/index.py b/home/views/index.py index c8d322b..8b8ee25 100644 --- a/home/views/index.py +++ b/home/views/index.py @@ -42,7 +42,7 @@ def get_context_data(self, **kwargs): .select_related("projectpost__author") ) study = ( - OnlineStudyPost.objects.all()[:3] + OnlineStudyPost.activate_objects.get_data()[:3] .annotate(table=Value("OnlineStudy")) .values( "pk", @@ -57,7 +57,7 @@ def get_context_data(self, **kwargs): ) ) blog = ( - BlogPost.objects.all()[:3] + BlogPost.activate_objects.get_data()[:3] .annotate(table=Value("Blog")) .values( "pk", @@ -72,7 +72,7 @@ def get_context_data(self, **kwargs): ) ) opensource = ( - OpenSourcePost.objects.all()[:3] + OpenSourcePost.activate_objects.get_data()[:3] .annotate(table=Value("OpenSource")) .values( "pk", @@ -87,7 +87,7 @@ def get_context_data(self, **kwargs): ) ) books = ( - BooksPost.objects.all()[:3] + BooksPost.activate_objects.get_data()[:3] .annotate(table=Value("Books")) .values( "pk", diff --git a/users/views/users_forms.py b/users/views/users_forms.py index 27def99..83f55e6 100644 --- a/users/views/users_forms.py +++ b/users/views/users_forms.py @@ -3,8 +3,6 @@ from django import forms from django.conf import settings from django.utils.translation import gettext_lazy as _ -from django.contrib.auth.hashers import check_password - from ..models import User, UserProfile from .validators import ( LoginVerificationEmailValidator,