mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-02 21:01:49 -05:00
Adding organization reference to the custom inventory script
This commit is contained in:
@@ -1235,6 +1235,7 @@ class CustomInventoryScript(CommonModel):
|
||||
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
unique_together = [('name', 'organization')]
|
||||
ordering = ('name',)
|
||||
|
||||
script = models.TextField(
|
||||
@@ -1242,6 +1243,12 @@ class CustomInventoryScript(CommonModel):
|
||||
default='',
|
||||
help_text=_('Inventory script contents'),
|
||||
)
|
||||
organization = models.ForeignKey(
|
||||
'Organization',
|
||||
related_name='custom_inventory_scripts',
|
||||
help_text=_('Organization owning this inventory script'),
|
||||
on_delete=models.CASCADE,
|
||||
)
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('api:inventory_script_detail', args=(self.pk,))
|
||||
|
||||
Reference in New Issue
Block a user