Saturday, March 29, 2014

Django (1.5) login exception (Save with update_fields did not affect any rows)

In my Django web app (running on Google App Engine), when a new user signs up a User object is created and then that user is authenticated and logged in. Every once in a while, the login function throws an exception (DatabaseError: Save with update_fields did not affect any rows) and I'm not really sure why this is happening (this is my first Django app).

newuser = User.objects.create_user(username, "", password)        newuser.first_name = username           # Create and save an associated accounts table to the system      models.Accounts(user=newuser).save()          # Authenticate the new user      newuser = authenticate(username=username, password=password)        # This is the login that occasionally throws an exception      login(request, newuser)

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment