title: Django Email Change Form Setup
body: <p>My email change form for users works, but I feel like my code is not written correctly. If I did it the way I have done below, I'd need a thousand else statements so that the page would return a response. Can someone tell me how I can make this more efficient/better? I'm not sure of the conventional way to do this</p>
  
  <p>Views.py</p>
  
  <pre><code>def email_change(request):
      form = Email_Change_Form()
      if request.method=='POST':
          form = Email_Change_Form(request.POST)
          if form.is_valid():
              if request.user.is_authenticated:
                  if form.cleaned_data['email1']  == form.cleaned_data['email2']:
                      user = request.user
                      u = User.objects.get(username=user)
                      # get the proper user
                      u.email = form.cleaned_data['email1'] 
                      u.save()
                      return HttpResponseRedirect("/accounts/profile/")
      else:
          return render_to_response("email_change.html", {'form':form}, context_instance=RequestContext(request))
  </code></pre>