mirror of
https://github.com/ansible/awx.git
synced 2026-01-10 15:32:07 -03:30
Merge pull request #668 from AlanCoding/null_cred_okay2
Do not filter out JTs with null credentials
This commit is contained in:
commit
71127c039d
@ -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'
|
||||
|
||||
@ -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'),
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user