From d9799d6f45538fd1ad1a54313e963a51cf9c710a Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Fri, 3 Feb 2017 21:45:35 -0500 Subject: [PATCH] fix accessible_pk_qs method in UJT subclasses --- awx/main/models/unified_jobs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index fdbe566fc2..7a7275a1fb 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -175,6 +175,9 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique, Notificatio Does not return inventory sources or system JTs, these should be handled inside of get_queryset where it is utilized. ''' + # do not use this if in a subclass + if cls != UnifiedJobTemplate: + return super(UnifiedJobTemplate, cls).accessible_pk_qs(accessor, role_field) ujt_names = [c.__name__.lower() for c in cls.__subclasses__() if c.__name__.lower() not in ['inventorysource', 'systemjobtemplate']] subclass_content_types = list(ContentType.objects.filter(