mirror of
https://github.com/ansible/awx.git
synced 2026-04-14 06:29:25 -02:30
do not filter out JTs with null credentials
This commit is contained in:
@@ -221,7 +221,6 @@ class JobTemplate(UnifiedJobTemplate, JobOptions, SurveyJobTemplateMixin, Resour
|
|||||||
playbook) to an inventory source with a given credential.
|
playbook) to an inventory source with a given credential.
|
||||||
'''
|
'''
|
||||||
SOFT_UNIQUE_TOGETHER = [('polymorphic_ctype', 'name')]
|
SOFT_UNIQUE_TOGETHER = [('polymorphic_ctype', 'name')]
|
||||||
PASSWORD_FIELDS = ('credential', 'vault_credential')
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
app_label = 'main'
|
app_label = 'main'
|
||||||
|
|||||||
@@ -53,16 +53,6 @@ def test_filter_on_password_field(password_field, lookup_suffix):
|
|||||||
assert 'not allowed' in str(excinfo.value)
|
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', [
|
@pytest.mark.parametrize('model, query', [
|
||||||
(AuthToken, 'request_hash__icontains'),
|
(AuthToken, 'request_hash__icontains'),
|
||||||
(User, 'password__icontains'),
|
(User, 'password__icontains'),
|
||||||
|
|||||||
@@ -381,8 +381,7 @@ angular.module('templates', [surveyMaker.name, templatesList.name, jobTemplates.
|
|||||||
value: {
|
value: {
|
||||||
page_size: '5',
|
page_size: '5',
|
||||||
order_by: 'name',
|
order_by: 'name',
|
||||||
inventory__isnull: false,
|
inventory__isnull: false
|
||||||
credential__isnull: false
|
|
||||||
},
|
},
|
||||||
squash: false,
|
squash: false,
|
||||||
dynamic: true
|
dynamic: true
|
||||||
|
|||||||
Reference in New Issue
Block a user