move inv src vault cred validation from view to model

This commit is contained in:
AlanCoding
2018-08-20 08:53:45 -04:00
parent 0868f97335
commit 9a85578925
5 changed files with 124 additions and 10 deletions

View File

@@ -1262,6 +1262,11 @@ class InventorySourceOptions(BaseModel):
'Credentials of type machine, source control, insights and vault are '
'disallowed for custom inventory sources.'
)
elif source == 'scm' and cred and cred.credential_type.kind in ('insights', 'vault'):
return _(
'Credentials of type insights and vault are '
'disallowed for scm inventory sources.'
)
return None
def get_inventory_plugin_name(self):