Can't add groups in the admin interface

118 views
Skip to first unread message

Kevin Cole

unread,
May 25, 2012, 10:21:08 AM5/25/12
to django...@googlegroups.com
Hi,

I'm using Django 1.3 with the "stock" admin interface. No customizations.  In the Site Administration, I can add new users. However, if I try to add a group I get the Add Group screen, with the fields for name and selection of permissions, and the three save buttons at the bottom ("Save and add", "Save and edit", "Save").  After filling out the form, and clicking any of the saves I end up at:

ValueError at /admin/auth/group/add/

'Group' instance needs to have a primary key value before a many-to-many relationship can be used.
Request Method: POST
Request URL: http://.../resources/admin/auth/group/add/
Django Version: 1.3.1
Exception Type: ValueError
Exception Value:
'Group' instance needs to have a primary key value before a many-to-many relationship can be used.
Exception Location: /usr/lib/python2.7/dist-packages/django/db/models/fields/related.py in __init__, line 493
Python Executable: /usr/bin/python
Python Version: 2.7.3
Python Path:
['/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/HTMLgen',
 '/usr/lib/python2.7/dist-packages/PIL',
 '/usr/lib/pymodules/python2.7/gtk-2.0',
 '/usr/lib/python2.7/dist-packages/gst-0.10',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/pymodules/python2.7',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
 '/usr/lib/python2.7/dist-packages/ubuntuone-installer',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol',
 '/usr/lib/python2.7/dist-packages/wx-2.6-gtk2-unicode',
 '/home/.../Django']

However, this works:

$ psql django
INSERT INTO auth_group (name) VALUES ('qwert');

and I can then use the interface to edit the permissions for the group.  (So far, "qwert" is the only group in the system.)  Adding users to group "qwert" works, but the permissions appear to be ignored.

Any idea what's hosed?

Thanks!


Kevin Cole

unread,
May 25, 2012, 10:28:31 AM5/25/12
to django...@googlegroups.com
P.S. Adding permissions to each user individually works (and those permissions are not ignored), and the database validates correctly according to "django-admin validate".
Reply all
Reply to author
Forward
0 new messages