changeset 233:8bfab90d4621

usersettings form processing: cosmetic fixes, don't save submit value to user profile
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 15 May 2011 15:29:37 +0200
parents e3bbbcb9aded
children f6e023768f35
files MoinMoin/apps/frontend/views.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/frontend/views.py	Sun May 15 01:32:23 2011 +0200
+++ b/MoinMoin/apps/frontend/views.py	Sun May 15 15:29:37 2011 +0200
@@ -1163,7 +1163,7 @@
                               )
     if request.method == 'GET':
         form = FormClass.from_object(flaskg.user)
-        form['submit'].set('Save') # XXX why does from_object() kill submit value?
+        form['submit'].set_default() # XXX from_object() kills all values
     elif request.method == 'POST':
         form = FormClass.from_flat(request.form)
         valid = form.validate()
@@ -1191,12 +1191,13 @@
                         flash(_('This email is already in use'), 'error')
                         success = False
                 if success:
-                    form.update_object(flaskg.user)
+                    form.update_object(flaskg.user, omit=['submit']) # don't save submit button value :)
                     flaskg.user.save()
                     return redirect(url_for('frontend.usersettings'))
                 else:
                     # reset to valid values
                     form = FormClass.from_object(flaskg.user)
+                    form['submit'].set_default() # XXX from_object() kills all values
     return render_template('usersettings.html',
                            item_name=item_name,
                            part=part,