Commits

Matthew Turk committed 8c4773d

Fixing up how the user data submission works

  • Participants
  • Parent commits 0840389

Comments (0)

Files changed (2)

ythub/templates/user.html

 <section style="padding-top:5.0em;">
     <div class="row">
       <div class="span12">
-        <form action="user" method=post class="form-horizontal">
+        <form action="/user/" method=post class="form-horizontal">
           <fieldset>
             <legend>User Information</legend>
             <div class="control-group">
 @app.route('/user/', methods=['POST'])
 @login_required
 def update_user(user):
+    print "Updating user"
     user.email = request.form.get("email")
     user.url = request.form.get("url")
     user.name = request.form.get("name")
     pw = request.form.get("password")
     if pw != "" and request.form.get('password2') != pw:
+        print "Passwords don't match"
         flash("New passwords don't match.")
         return redirect("/user")
     elif pw != "":
+        print "Setting password"
         user.set_password(pw)
     db_session.commit()
+    print "Redirecting"
     flash("Updated!")
     return redirect("/user")