Commit 4aff8d42 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen
Browse files

community/py3-django-oscar: crash fix

parent 2b21e131
From 992d2df488ea2cf93b550622771f8d952d94465f Mon Sep 17 00:00:00 2001
From: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
Date: Mon, 29 Mar 2021 18:27:25 +0300
Subject: [PATCH] SimpleProductSearchHandler: do not crash on empty page field
---
src/oscar/apps/catalogue/search_handlers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/oscar/apps/catalogue/search_handlers.py b/src/oscar/apps/catalogue/search_handlers.py
index ed2b62711..a56529bfe 100644
--- a/src/oscar/apps/catalogue/search_handlers.py
+++ b/src/oscar/apps/catalogue/search_handlers.py
@@ -90,7 +90,7 @@ class SimpleProductSearchHandler(MultipleObjectMixin):
def __init__(self, request_data, full_path, categories=None):
self.categories = categories
- self.kwargs = {'page': request_data.get('page', 1)}
+ self.kwargs = {'page': request_data.get('page') or 1}
self.object_list = self.get_queryset()
def get_queryset(self):
--
2.30.2
......@@ -2,7 +2,7 @@
# Maintainer: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
pkgname=py3-django-oscar
pkgver=2.1
pkgrel=4
pkgrel=5
pkgdesc="Domain-driven e-commerce for Django"
url="http://oscarcommerce.com/"
arch="noarch"
......@@ -13,6 +13,7 @@ depends="py3-babel py3-django py3-django-extra-views py3-django-haystack
py3-factory-boy py3-pillow py3-purl"
makedepends="gettext py3-setuptools"
source="https://files.pythonhosted.org/packages/source/d/django-oscar/django-oscar-$pkgver.tar.gz
0001-SimpleProductSearchHandler-do-not-crash-on-empty-pag.patch
django-3.1.patch
translation.patch
"
......@@ -39,5 +40,6 @@ package() {
}
sha512sums="b8279eadb637fec4d9979d037fd86c61e16c3a9be518158cc14505200a8b30d1226ac17da6535a724d3f4e71789dab5b7a3583c28c6d6f8480db66a994568ed2 django-oscar-2.1.tar.gz
bc7ca2cc88d119fe366415531ea09a78df3e242223edea00ede56f77efd7628010fc21237ba7ec6cfc9f7e1ea0c70e8f84ed5363bd6d7ec3b3a68c91da469ea5 0001-SimpleProductSearchHandler-do-not-crash-on-empty-pag.patch
b08eaf7510d87cd1e7c904b35fcb156ffa5e063da4af93e540b0ba580709fd8dc6b98fb27db4ea8e57711a4f3d404b145524fcb9bf6a23a58886d7b7b071e2f5 django-3.1.patch
8c49764a5aa44b8c3309f673a3c6f43da1a545cca10e02c8a8868d350b0012c938b9436ab8d20b50e012cfec872af482f7b35d2d5f5ac557f1286224f4704a9e translation.patch"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment