Merge pull request #668 from AlanCoding/null_cred_okay2

Do not filter out JTs with null credentials
This commit is contained in:
Alan Rominger 2017-11-16 11:18:16 -05:00 committed by GitHub
commit 71127c039d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 13 deletions

View File

@ -222,7 +222,6 @@ class JobTemplate(UnifiedJobTemplate, JobOptions, SurveyJobTemplateMixin, Resour
playbook) to an inventory source with a given credential.
'''
SOFT_UNIQUE_TOGETHER = [('polymorphic_ctype', 'name')]
PASSWORD_FIELDS = ('credential', 'vault_credential')
class Meta:
app_label = 'main'

View File

@ -53,16 +53,6 @@ def test_filter_on_password_field(password_field, lookup_suffix):
assert 'not allowed' in str(excinfo.value)
@pytest.mark.parametrize('lookup_suffix', ['', 'contains', 'startswith', 'in'])
@pytest.mark.parametrize('password_field', Credential.PASSWORD_FIELDS)
def test_filter_on_related_password_field(password_field, lookup_suffix):
field_lookup = FieldLookupBackend()
lookup = '__'.join(filter(None, ['credential', password_field, lookup_suffix]))
with pytest.raises(PermissionDenied) as excinfo:
field, new_lookup = field_lookup.get_field_from_lookup(JobTemplate, lookup)
assert 'not allowed' in str(excinfo.value)
@pytest.mark.parametrize('model, query', [
(AuthToken, 'request_hash__icontains'),
(User, 'password__icontains'),

View File

@ -381,8 +381,7 @@ angular.module('templates', [surveyMaker.name, templatesList.name, jobTemplates.
value: {
page_size: '5',
order_by: 'name',
inventory__isnull: false,
credential__isnull: false
inventory__isnull: false
},
squash: false,
dynamic: true