--- a/HelloForge/helloforge/main.py
+++ b/HelloForge/helloforge/main.py
@@ -161,15 +161,15 @@
return None
@expose('helloforge.templates.page_view')
- @validate(dict(version=V.Int()))
+ @validate(dict(version=V.Int(if_empty=None)))
def index(self, version=None):
require(has_artifact_access('read', self.page))
page = self.get_version(version)
if page is None:
if version: redirect('.?version=%d' % (version-1))
else: redirect('.')
- cur = page.version - 1
- if cur > 0: prev = cur-1
+ cur = page.version
+ if cur > 1: prev = cur-1
else: prev = None
next = cur+1
return dict(page=page,
@@ -194,8 +194,6 @@
require(has_artifact_access('read', self.page))
p1 = self.get_version(int(v1))
p2 = self.get_version(int(v2))
- p1.version -= 1
- p2.version -= 1
t1 = p1.text
t2 = p2.text
differ = difflib.SequenceMatcher(None, p1.text, p2.text)