#16509: init test db: try insert a existing permission
(django.db.utils.IntegrityError: columns content_type_id, codename are not
unique)
-------------------------------------+-------------------------------------
     Reporter:  rogeliomita@…        |                    Owner:  tobias
         Type:  Bug                  |                   Status:  assigned
    Component:                       |                  Version:  1.3
  contrib.contenttypes               |               Resolution:
     Severity:  Release blocker      |             Triage Stage:  Accepted
     Keywords:  not unique,          |      Needs documentation:  0
  permission, auth                   |  Patch needs improvement:  0
    Has patch:  0                    |                    UI/UX:  0
  Needs tests:  0                    |
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by tobias):

 It is true that this is a regression insofar as searched_perms used to be
 a set, but I am not sure how to reproduce this in a test.  It also sounds
 like the original ticket author has since discovered that this was an
 issue with the South migration and was able to fix it outside of Django.

 If needed, the fix would be easy enough:

 {{{
 for perm in _get_all_permissions(klass._meta):
     if (ctype, perm) not in searched_perms:
         searched_perms.append((ctype, perm))
 }}}

 instead of:

 {{{
 for perm in _get_all_permissions(klass._meta):
     searched_perms.append((ctype, perm))
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16509#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to