diff MoinMoin/items/__init__.py @ 243:69c0d9f6981d

modify: put real base rev no into the hidden form field
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 29 May 2011 20:40:03 +0200
parents e93157b8b0bd
children a11656ba1eab
line wrap: on
line diff
--- a/MoinMoin/items/__init__.py	Sun May 29 19:57:17 2011 +0200
+++ b/MoinMoin/items/__init__.py	Sun May 29 20:40:03 2011 +0200
@@ -693,7 +693,7 @@
             form = ModifyForm.from_defaults()
             TextCha(form).amend_form()
             form['meta_text'] = self.meta_dict_to_text(self.meta)
-            form['rev'] = 0 # XXX ???
+            form['rev'] = self.rev.revno if self.rev.revno is not None else -1
         elif request.method == 'POST':
             form = ModifyForm.from_flat(request.form)
             TextCha(form).amend_form()
@@ -1158,7 +1158,7 @@
             else:
                 form['data_text'] = self.data_storage_to_internal(self.data)
             form['meta_text'] = self.meta_dict_to_text(self.meta)
-            form['rev'] = 0 # XXX ???
+            form['rev'] = self.rev.revno if self.rev.revno is not None else -1
         elif request.method == 'POST':
             form = ModifyForm.from_flat(request.form)
             TextCha(form).amend_form()
@@ -1349,7 +1349,7 @@
             TextCha(form).amend_form()
             # XXX currently this is rather pointless, as the form does not get POSTed:
             form['meta_text'] = self.meta_dict_to_text(self.meta)
-            form['rev'] = 0 # XXX ???
+            form['rev'] = self.rev.revno if self.rev.revno is not None else -1
         elif request.method == 'POST':
             # this POST comes directly from TWikiDraw (not from Browser), thus no validation
             try:
@@ -1441,7 +1441,7 @@
             TextCha(form).amend_form()
             # XXX currently this is rather pointless, as the form does not get POSTed:
             form['meta_text'] = self.meta_dict_to_text(self.meta)
-            form['rev'] = 0 # XXX ???
+            form['rev'] = self.rev.revno if self.rev.revno is not None else -1
         elif request.method == 'POST':
             # this POST comes directly from AnyWikiDraw (not from Browser), thus no validation
             try:
@@ -1529,7 +1529,7 @@
             TextCha(form).amend_form()
             # XXX currently this is rather pointless, as the form does not get POSTed:
             form['meta_text'] = self.meta_dict_to_text(self.meta)
-            form['rev'] = 0 # XXX ???
+            form['rev'] = self.rev.revno if self.rev.revno is not None else -1
         elif request.method == 'POST':
             # this POST comes directly from SvgDraw (not from Browser), thus no validation
             try: