Ticket #14731: permission-id-fix-20101119.diff

File permission-id-fix-20101119.diff, 914 bytes (added by Christian Hammond, 14 years ago)

Patch to retain a consistent order for permission IDs.

  • django/contrib/auth/management/__init__.py

     
    2323
    2424    # This will hold the permissions we're looking for as
    2525    # (content_type, (codename, name))
    26     searched_perms = set()
     26    searched_perms = []
    2727    # The codenames and ctypes that should exist.
    2828    ctypes = set()
    2929    for klass in app_models:
    3030        ctype = ContentType.objects.get_for_model(klass)
    3131        ctypes.add(ctype)
    3232        for perm in _get_all_permissions(klass._meta):
    33             searched_perms.add((ctype, perm))
     33            searched_perms.append((ctype, perm))
    3434
    3535    # Find all the Permissions that have a context_type for a model we're
    3636    # looking for.  We don't need to check for codenames since we already have
Back to Top