Question: I'm working on an algorithm that makes a guess at K for kmeans clustering. I guess I'm looking for a data set that I could use as a comparison, or maybe a few data sets where the number of clusters is "known" so I could see how my algorithm is doing at guessing K.

Answer: 
Your issue is here:

```
user = User.objects.get(request.user)

```

Ideally, it would have been

```
user = User.objects.get(id=request.user.id)

```

You dont need a query to retrieve the user object here, since `request.user` evaluates to an instance of the logged in user object.

```
user = request.user
user.set_password(form.cleaned_data['password1'])
user.email = form.cleaned_data['email']
user.save()

```

Should work

Also, make sure you have the [`@login_required`](https://docs.djangoproject.com/en/1.2/topics/auth/#the-login-required-decorator) decorator to the `account_admin` method
Thanks so much karthikr and Daniel! Heres how i got it to work:

```
def account_admin(request):
if request.method == 'POST':
    mod_form = ModificationForm(request.POST)
    if mod_form.is_valid():
        user = User.objects.get(id=request.user.id)
        user.set_password(mod_form.cleaned_data['password1'])
        user.email = mod_form.cleaned_data['email']
        user.save()
        return HttpResponseRedirect('/register/success/')
else:
    mod_form = ModificationForm()

variables = RequestContext(request, {
    'mod_form': mod_form
})
return render_to_response('registration/account.html', variables)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

```

karthikr, iam still learning django, i dont get your sugestion of the decorator @login\_required. What does it do?