Fixing final CI error

This commit is contained in:
John Westcott IV 2023-04-25 08:45:28 -04:00 committed by John Westcott IV
parent c3045b1169
commit 2cee1caad2
2 changed files with 5 additions and 9 deletions

View File

@ -2,9 +2,6 @@
# Python
from __future__ import unicode_literals
# Psycopg2
from psycopg import sql
# Django
from django.db import connection, migrations, models, OperationalError, ProgrammingError
from django.conf import settings
@ -136,12 +133,8 @@ class Migration(migrations.Migration):
),
),
migrations.RunSQL(
[
"CREATE INDEX host_ansible_facts_default_gin ON {} USING gin(ansible_facts jsonb_path_ops);".format(
sql.Identifier(Host._meta.db_table).as_string(connection.cursor())
)
],
[('DROP INDEX host_ansible_facts_default_gin;', None)],
sql="CREATE INDEX host_ansible_facts_default_gin ON {} USING gin(ansible_facts jsonb_path_ops);".format(Host._meta.db_table),
reverse_sql='DROP INDEX host_ansible_facts_default_gin;',
),
# SCM file-based inventories
migrations.AddField(

View File

@ -195,6 +195,9 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique, ResourceMixin):
@cached_property
def dynamic_input_fields(self):
# if the credential is not yet saved we can't access the input_sources
if not self.id:
return []
return [obj.input_field_name for obj in self.input_sources.all()]
def _password_field_allows_ask(self, field):