Fixed up some RBAC indexing

This commit is contained in:
Akita Noek
2016-04-17 10:20:38 -04:00
parent a9f2507e91
commit 85843cc6ad
2 changed files with 3 additions and 3 deletions

View File

@@ -97,7 +97,7 @@ class Migration(migrations.Migration):
), ),
migrations.AlterIndexTogether( migrations.AlterIndexTogether(
name='roleancestorentry', name='roleancestorentry',
index_together=set([('descendent', 'content_type_id', 'role_field'), ('ancestor', 'content_type_id', 'role_field')]), index_together=set([('ancestor', 'content_type_id', 'object_id'), ('ancestor', 'content_type_id', 'role_field')]),
), ),
migrations.AddField( migrations.AddField(

View File

@@ -360,8 +360,8 @@ class RoleAncestorEntry(models.Model):
verbose_name_plural = _('role_ancestors') verbose_name_plural = _('role_ancestors')
db_table = 'main_rbac_role_ancestors' db_table = 'main_rbac_role_ancestors'
index_together = [ index_together = [
("ancestor", "content_type_id", "role_field"), ("ancestor", "content_type_id", "object_id"), # used by get_roles_on_resource
("descendent", "content_type_id", "role_field"), ("ancestor", "content_type_id", "role_field"), # used by accessible_objects
] ]
descendent = models.ForeignKey(Role, null=False, on_delete=models.CASCADE, related_name='+') descendent = models.ForeignKey(Role, null=False, on_delete=models.CASCADE, related_name='+')