From 9101adc8ba66556c98f3955138d72b3492a6a60c Mon Sep 17 00:00:00 2001 From: Marcelo Galigniana Date: Thu, 13 Oct 2022 12:09:25 +0200 Subject: [PATCH] Removed unused branch in Paginator.validate_number(). Unused since 96cf3656c48f6c42714a70b4546bc42f7b904185. --- django/core/paginator.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/django/core/paginator.py b/django/core/paginator.py index 568445607e..131ea0f811 100644 --- a/django/core/paginator.py +++ b/django/core/paginator.py @@ -51,10 +51,7 @@ class Paginator: if number < 1: raise EmptyPage(_("That page number is less than 1")) if number > self.num_pages: - if number == 1 and self.allow_empty_first_page: - pass - else: - raise EmptyPage(_("That page contains no results")) + raise EmptyPage(_("That page contains no results")) return number def get_page(self, number):