mirror of
https://github.com/ansible/awx.git
synced 2026-03-31 07:45:08 -02:30
AC-1071 Moved credential model to its own file. Added API support and tests for ssh_key_path field.
AC-1095 Added validation for SSH private keys.
This commit is contained in:
@@ -233,7 +233,7 @@ def model_instance_diff(old, new, serializer_mapping=None):
|
||||
When provided, read-only fields will not be included in the resulting dictionary
|
||||
"""
|
||||
from django.db.models import Model
|
||||
from awx.main.models.organization import Credential
|
||||
from awx.main.models.credential import Credential
|
||||
|
||||
if not(old is None or isinstance(old, Model)):
|
||||
raise TypeError('The supplied old instance is not a valid model instance.')
|
||||
@@ -281,7 +281,7 @@ def model_to_dict(obj, serializer_mapping=None):
|
||||
serializer_mapping are used to determine read-only fields.
|
||||
When provided, read-only fields will not be included in the resulting dictionary
|
||||
"""
|
||||
from awx.main.models.organization import Credential
|
||||
from awx.main.models.credential import Credential
|
||||
attr_d = {}
|
||||
if serializer_mapping is not None and obj.__class__ in serializer_mapping:
|
||||
serializer_actual = serializer_mapping[obj.__class__]()
|
||||
|
||||
Reference in New Issue
Block a user