better insights_credential reverse relationship

* From an insights cred, access all related inventories via
cred.insights_inventories rather than cred.insights_credential
* This fixes auto-attaching insights_credential to credential summary
fields. Fixes by NOT attaching them. That is the desired behavior.
This commit is contained in:
Chris Meyers
2017-06-05 13:43:09 -04:00
parent e1a0eec29f
commit 0d56f42c83
2 changed files with 2 additions and 2 deletions

View File

@@ -146,7 +146,7 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin):
])
insights_credential = models.ForeignKey(
'Credential',
related_name='insights_credential',
related_name='insights_inventories',
help_text=_('Credentials to be used by hosts belonging to this inventory when accessing Red Hat Insights API.'),
on_delete=models.SET_NULL,
blank=True,