Commits

Anonymous committed 4cd1f3f

[svn] Fix and/or false condition resulting in second statement always evaluating.

  • Participants
  • Parent commits 7b1ba30

Comments (0)

Files changed (1)

webhelpers/pagination/__init__.py

     current = property(**current())
     
     def __len__(self):
-        return (self.item_count == 0) and 0 or (((self.item_count - 1)//self.items_per_page) + 1)
+        if self.item_count == 0:
+            return 0
+        else:
+            return ((self.item_count - 1)//self.items_per_page) + 1
     
     def __iter__(self):
         for i in range(0, len(self)):