Correct a bug when saving preferences.
authorfabien@tzone.org
Sun, 28 Dec 2008 13:45:41 -0500
changeset 61 a1bcf5e4b8a4
parent 60 dad9733c99f0
child 62 56193b37f666
Correct a bug when saving preferences.
lib/actions/edit_prefs.py
templates/prefs.tmpl
--- a/lib/actions/edit_prefs.py	Sun Dec 28 12:41:44 2008 -0500
+++ b/lib/actions/edit_prefs.py	Sun Dec 28 13:45:41 2008 -0500
@@ -12,7 +12,7 @@
     if form.has_key('fullname'):
     	prefs['fullname'] = form['fullname'].value
     db.set_preferences(prefs)
-    load_index(db, prefs, form, "result", "Preferences saved.")
+    load_index(db, db.get_preferences(), form, "result", "Preferences saved.")
 
 def view_prefs(prefs):
     tmpl = Template("prefs.tmpl", prefs)
@@ -31,12 +31,12 @@
 
 def do_it(action, db, prefs, form):
 	if form.has_key('step'):
-		step = form['step']
+		step = form['step'].value
 	else:
 		step = 'view'
 	if step == 'view':
 		view_prefs(prefs)
 	elif step == 'edit':
-		edit_prefs(prefs)
+		edit_prefs(db, prefs, form)
 	else:	
 		load_index(db, prefs, form, "error", "Operation cancel.")
--- a/templates/prefs.tmpl	Sun Dec 28 12:41:44 2008 -0500
+++ b/templates/prefs.tmpl	Sun Dec 28 13:45:41 2008 -0500
@@ -29,7 +29,7 @@
 	<input type="checkbox" name="kw_reverse"
 	  <TMPL_IF kw_reverse>checked</TMPL_IF>>
 	reversed</p>
-	<button name="step" value="edit" type="submit">Submit</button>
+	<button name="step" value="edit" type="submit">Save</button>
 	<button name="step" value="cancel" type="submit">Cancel</button>
     </form>
     <hr/>