From 4aa8db63a72edd328037147eeca9c4e6b9c78c06 Mon Sep 17 00:00:00 2001 From: Gleb Mikhaylov Date: Mon, 26 Aug 2019 12:31:03 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D1=83=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BB-=D0=B2=D0=BE=20=D1=83=D1=87=D0=B8=D1=82=D0=B5=D0=BB?= =?UTF-8?q?=D0=B5=D0=B9=20>=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project/views.py b/project/views.py index 53edf673..9c3ac5b2 100644 --- a/project/views.py +++ b/project/views.py @@ -105,7 +105,8 @@ class IndexView(TemplateView): shuffle(review_images) teachers = User.objects.filter( role=User.TEACHER_ROLE, show_in_mainpage=True) - if teachers.count() % 2 == 0: + + if teachers.count() % 2 == 0 and teachers.count() > 2: teachers = teachers[:teachers.count() - 1] context.update({