﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19133	Possible regression in admin user editor	Daniel Swarbrick	nobody	"Commit c433fcb3fb34fccd69782979f0e7cd5f2d4a4893 seems to have caused a regression in at least two existing projects of mine. I zeroed in on this particular commit after doing a git bisect.

The problem can be triggered by simply opening the admin site, editing any user, and click Save without changing any fields.

The following traceback is thrown:

{{{
Environment:


Request Method: POST
Request URL: http://localhost:8000/admin/auth/user/1/

Django Version: 1.5.dev20121016080329
Python Version: 2.7.3
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.messages',
 'django.contrib.sessions',
 'django.contrib.staticfiles',
 'diffcon',
 'diffcon.netblock',
 'diffcon.schedule',
 'diffcon.user')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File ""/usr/lib/python2.7/dist-packages/django/core/handlers/base.py"" in get_response
  116.                         response = callback(request, *callback_args, **callback_kwargs)
File ""/usr/lib/python2.7/dist-packages/django/contrib/admin/options.py"" in wrapper
  367.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File ""/usr/lib/python2.7/dist-packages/django/utils/decorators.py"" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File ""/usr/lib/python2.7/dist-packages/django/views/decorators/cache.py"" in _wrapped_view_func
  89.         response = view_func(request, *args, **kwargs)
File ""/usr/lib/python2.7/dist-packages/django/contrib/admin/sites.py"" in inner
  202.             return view(request, *args, **kwargs)
File ""/usr/lib/python2.7/dist-packages/django/utils/decorators.py"" in _wrapper
  25.             return bound_func(*args, **kwargs)
File ""/usr/lib/python2.7/dist-packages/django/utils/decorators.py"" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File ""/usr/lib/python2.7/dist-packages/django/utils/decorators.py"" in bound_func
  21.                 return func(self, *args2, **kwargs2)
File ""/usr/lib/python2.7/dist-packages/django/db/transaction.py"" in inner
  208.                 return func(*args, **kwargs)
File ""/usr/lib/python2.7/dist-packages/django/contrib/admin/options.py"" in change_view
  1054.                 self.save_model(request, new_object, form, True)
File ""/usr/lib/python2.7/dist-packages/django/contrib/admin/options.py"" in save_model
  710.         obj.save()
File ""/usr/lib/python2.7/dist-packages/django/db/models/base.py"" in save
  532.                        force_update=force_update, update_fields=update_fields)
File ""/usr/lib/python2.7/dist-packages/django/db/models/base.py"" in save_base
  603.                             rows = manager.using(using).filter(pk=pk_val)._update(values)
File ""/usr/lib/python2.7/dist-packages/django/db/models/query.py"" in _update
  580.         return query.get_compiler(self.db).execute_sql(None)
File ""/usr/lib/python2.7/dist-packages/django/db/models/sql/compiler.py"" in execute_sql
  997.         cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File ""/usr/lib/python2.7/dist-packages/django/db/models/sql/compiler.py"" in execute_sql
  825.         cursor.execute(sql, params)
File ""/usr/lib/python2.7/dist-packages/django/db/backends/util.py"" in execute
  43.             return self.cursor.execute(sql, params)
File ""/usr/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py"" in execute
  56.             six.reraise(utils.IntegrityError, utils.IntegrityError(*tuple(e.args)), sys.exc_info()[2])
File ""/usr/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py"" in execute
  54.             return self.cursor.execute(query, args)

Exception Type: IntegrityError at /admin/auth/user/1/
Exception Value: null value in column ""password"" violates not-null constraint
}}}
"	Bug	closed	contrib.auth	dev	Release blocker	fixed			Accepted	1	0	0	0	0	0
