Currently running "Version 1.99.2 (2011-09-26 06:55:33) stable", not
sure what other versions that this applies to.

Symptoms:
"Revert" button in app edit page does not work properly.  After
pressing the revert button a "file saved on <date>" message is
flashed, but it won't restore the code to the previous version.

Problem:
The edit() function in default.py is checking to see if
request.vars.revert==True.  Since request.vars.revert="" this test
fails and the code required to revert the file from the .bak file is
never executed.

Solution:

.../admin/default/edit/welcome/controllers/default.py
diff -u default.orig.py default.py
--- default.orig.py     Thu Nov 17 12:12:48 2011
+++ default.py  Thu Nov 17 12:10:05 2011
@@ -397,7 +397,7 @@

     path = apath(filename, r=request)

-    if request.vars.revert and os.path.exists(path + '.bak'):
+    if ('revert' in request.vars) and os.path.exists(path + '.bak'):
         try:
             data = safe_read(path + '.bak')
             data1 = safe_read(path)

Reply via email to