Skip to content

Commit 892a71f

Browse files
committed
Fix old migration related error
1 parent 7d44499 commit 892a71f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ansible_base/rbac/managed.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ def get_content_type(self, apps):
3939
model = self.get_model(apps)
4040
if model is None:
4141
return None
42-
content_type_cls = apps.get_model('dab_rbac', 'DABContentType')
42+
# NOTE: this is subject to major migration-related hazards
43+
try:
44+
content_type_cls = apps.get_model('dab_rbac', 'DABContentType')
45+
except LookupError:
46+
content_type_cls = apps.get_model('contenttypes', 'ContentType')
4347
return content_type_cls.objects.get_for_model(model)
4448

4549
def get_or_create(self, apps):

0 commit comments

Comments
 (0)