@login_required
def profile_update(request, template=u'accounts/account_profile_update.html', extra_context=None):
 profile_form = get_profile_form()
 form = profile_form((request.POST or None), (request.FILES or None), instance=request.user)
 if ((request.method == u'POST') and form.is_valid()):
  user = form.save()
  info(request, _(u'Profile updated'))
  try:
   return redirect(u'profile', username=user.username)
  except NoReverseMatch:
   return redirect(u'profile_update')
 context = {u'form': form, u'title': _(u'Update Profile')}
 context.update((extra_context or {}))
 return TemplateResponse(request, template, context)

@ login_required def profile_update ( request , template = u'accounts/account_profile_update.html' , extra_context = None ) : profile_form = get_profile_form ( ) form = profile_form ( ( request . POST or None ) , ( request . FILES or None ) , instance = request . user ) if ( ( request . method == u'POST' ) and form . is_valid ( ) ) : user = form . save ( ) info ( request , _ ( u'Profile updated' ) ) try : return redirect ( u'profile' , username = user . username ) except NoReverseMatch : return redirect ( u'profile_update' ) context = { u'form' : form , u'title' : _ ( u'Update Profile' ) } context . update ( ( extra_context or { } ) ) return TemplateResponse ( request , template , context )
profile update form .