Commits

Thomas Waldmann  committed 8bfab90

usersettings form processing: cosmetic fixes, don't save submit value to user profile

  • Participants
  • Parent commits e3bbbcb

Comments (0)

Files changed (1)

File MoinMoin/apps/frontend/views.py

                               )
     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()
                         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,