fixed a bug anoop
authornishanth
Fri, 03 Sep 2010 16:33:33 +0530
branchanoop
changeset 242 6826f27064c9
parent 241 ac1f13b2b3dc
child 243 011eac43bea3
fixed a bug
sdi/views.py
--- a/sdi/views.py	Fri Sep 03 16:23:17 2010 +0530
+++ b/sdi/views.py	Fri Sep 03 16:33:33 2010 +0530
@@ -272,17 +272,16 @@
     except Registrant.DoesNotExist:
         raise Http404
 
-    form = EditAddressForm(instance=user)
-    if request.method == "POST"
+    if request.method == "POST":
         form = EditAddressForm(request.POST, instance=user)
         if form.is_valid():
             form.save()
             #send_addr_upd_email(user)
+            return render_to_response("address_updated.html", {"user":user})
         else:
-            return render_to_response("address_updated.html", {"user":user})
-
-        return render_to_response("address_updated.html", {"user":user})
+            return render_to_response("update_address.html", {"user":user, 'form':form})
     else:
+        form = EditAddressForm(instance=user)
         return render_to_response("update_address.html", {"user":user, 'form':form})
 
 def admin_login(request):