[FIX] website - force to test isdigit on a string else a tb "'int' object has no attribute 'isdigit'" can exist if the page var was right and so already and int

This commit is contained in:
Jeremy Kersten 2014-06-30 12:27:49 +02:00
parent 7ba41e75e2
commit f4733aa895
1 changed files with 1 additions and 1 deletions

View File

@ -250,7 +250,7 @@ class website(osv.osv):
# Compute Pager
page_count = int(math.ceil(float(total) / step))
page = max(1, min(int(page if page.isdigit() else 1), page_count))
page = max(1, min(int(page if str(page).isdigit() else 1), page_count))
scope -= 1
pmin = max(page - int(math.floor(scope/2)), 1)