allow smart inventory to be created

related to https://github.com/ansible/ansible-tower/issues/7261
This commit is contained in:
Chris Meyers
2017-07-24 10:48:03 -04:00
parent f175fbba23
commit eaddafc920
2 changed files with 7 additions and 1 deletions

View File

@@ -370,7 +370,7 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin):
return self.groups.exclude(parents__pk__in=group_pks).distinct()
def clean_insights_credential(self):
if self.kind == 'smart':
if self.kind == 'smart' and self.insights_credential:
raise ValidationError(_("Assignment not allowed for Smart Inventory"))
if self.insights_credential and self.insights_credential.credential_type.kind != 'insights':
raise ValidationError(_("Credential kind must be 'insights'."))