updated the view anoop
authornishanth
Fri, 03 Sep 2010 16:17:19 +0530
branchanoop
changeset 239 b706790a1001
parent 238 30e39c985e2f
child 240 b29465f479ea
updated the view
sdi/views.py
--- a/sdi/views.py	Fri Sep 03 16:08:40 2010 +0530
+++ b/sdi/views.py	Fri Sep 03 16:17:19 2010 +0530
@@ -272,15 +272,18 @@
     except Registrant.DoesNotExist:
         raise Http404
 
-    form = EditAddressForm(request.POST, instance=user)
-    if request.method == "POST" and form.is_valid():
-        form.save()
-
-        send_addr_upd_email(user)
+    form = EditAddressForm(instance=user)
+    if request.method == "POST"
+        form = EditAddressForm(request.POST, instance=user)
+        if form.is_valid():
+            form.save()
+            #send_addr_upd_email(user)
+        else:
+            return render_to_response("address_updated.html", {"user":user})
 
         return render_to_response("address_updated.html", {"user":user})
     else:
-        return render_to_response("update_address.html", {"user":user})
+        return render_to_response("update_address.html", {"user":user, 'form':form})
 
 def admin_login(request):
     """ basic login.