Add collection setting toggle to UI

Additional API housekeeping, removing unused code

Treat default branch as no branch provided
This commit is contained in:
AlanCoding
2019-08-06 09:16:51 -04:00
parent 79a1dbc5a0
commit 2f3aafe1bb
4 changed files with 8 additions and 3 deletions

View File

@@ -399,6 +399,10 @@ class JobTemplate(UnifiedJobTemplate, JobOptions, SurveyJobTemplateMixin, Resour
# no-op case: Fields the same as template's value # no-op case: Fields the same as template's value
# counted as neither accepted or ignored # counted as neither accepted or ignored
continue continue
elif field_name == 'scm_branch' and old_value == '' and self.project and new_value == self.project.scm_branch:
# special case of "not provided" for branches
# job template does not provide branch, runs with default branch
continue
elif getattr(self, ask_field_name): elif getattr(self, ask_field_name):
# Special case where prompts can be rejected based on project setting # Special case where prompts can be rejected based on project setting
if field_name == 'scm_branch': if field_name == 'scm_branch':

View File

@@ -702,8 +702,7 @@ class BaseTask(object):
abstract = True abstract = True
proot_show_paths = [] proot_show_paths = []
def __init__(self, *args, **kwargs): def __init__(self):
super(BaseTask, self).__init__(*args, **kwargs)
self.cleanup_paths = [] self.cleanup_paths = []
def update_model(self, pk, _attempt=0, **updates): def update_model(self, pk, _attempt=0, **updates):

View File

@@ -137,7 +137,6 @@
delegate_to: localhost delegate_to: localhost
- block: - block:
# TODO: don't run this if ansible verison doens't support collections
- name: detect collections/requirements.yml - name: detect collections/requirements.yml
stat: path={{project_path|quote}}/collections/requirements.yml stat: path={{project_path|quote}}/collections/requirements.yml
register: doesCollectionRequirementsExist register: doesCollectionRequirementsExist

View File

@@ -61,6 +61,9 @@ export default ['i18n', function(i18n) {
AWX_ROLES_ENABLED: { AWX_ROLES_ENABLED: {
type: 'toggleSwitch', type: 'toggleSwitch',
}, },
AWX_COLLECTIONS_ENABLED: {
type: 'toggleSwitch',
},
AWX_TASK_ENV: { AWX_TASK_ENV: {
type: 'textarea', type: 'textarea',
reset: 'AWX_TASK_ENV', reset: 'AWX_TASK_ENV',