@allow_unvouched
@never_cache
def delete_email(request, email_pk):
 user = User.objects.get(pk=request.user.id)
 profile = user.userprofile
 if (not ExternalAccount.objects.filter(user=profile, pk=email_pk).exists()):
  raise Http404()
 ExternalAccount.objects.get(pk=email_pk).delete()
 return redirect('phonebook:profile_edit')

@ allow_unvouched @ never_cache def delete_email ( request , email_pk ) : user = User . objects . get ( pk = request . user . id ) profile = user . userprofile if ( not ExternalAccount . objects . filter ( user = profile , pk = email_pk ) . exists ( ) ) : raise Http404 ( ) ExternalAccount . objects . get ( pk = email_pk ) . delete ( ) return redirect ( 'phonebook:profile_edit' )
delete alternate email address .