From f6da30dde3d3b4d3fb3080f7fe0a453bb8bee8be Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Fri, 27 May 2016 09:32:29 -0400 Subject: [PATCH] Avoid unnecessary license checks --- awx/main/access.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/awx/main/access.py b/awx/main/access.py index c58da4bcd9..1674e38786 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -820,14 +820,12 @@ class JobTemplateAccess(BaseAccess): data = dict(data) if self.changes_are_non_sensitive(obj, data): - if 'job_type' in data and data['job_type'] == PERM_INVENTORY_SCAN: + if 'job_type' in data and obj.job_type != data['job_type'] and data['job_type'] == PERM_INVENTORY_SCAN: self.check_license(feature='system_tracking') - if 'survey_enabled' in data and data['survey_enabled']: + if 'survey_enabled' in data and obj.survey_enabled != data['survey_enabled'] and data['survey_enabled']: self.check_license(feature='surveys') - print('Changes are non senstivie') return True - print('Changes were senstivie') for required_field in ('credential', 'cloud_credential', 'inventory', 'project'): required_obj = getattr(obj, required_field, None)