mirror of
https://github.com/ansible/awx.git
synced 2026-03-20 02:17:37 -02:30
Merge pull request #6484 from ryanpetrello/inv-source-required
prevent manual updates at POST /api/v2/inventory_sources/N/update/ Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -1345,6 +1345,12 @@ class InventorySource(UnifiedJobTemplate, InventorySourceOptions, CustomVirtualE
|
|||||||
def get_absolute_url(self, request=None):
|
def get_absolute_url(self, request=None):
|
||||||
return reverse('api:inventory_source_detail', kwargs={'pk': self.pk}, request=request)
|
return reverse('api:inventory_source_detail', kwargs={'pk': self.pk}, request=request)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def can_update(self):
|
||||||
|
if self.source == '':
|
||||||
|
return False
|
||||||
|
return super(InventorySource, self).can_update
|
||||||
|
|
||||||
def _can_update(self):
|
def _can_update(self):
|
||||||
if self.source == 'custom':
|
if self.source == 'custom':
|
||||||
return bool(self.source_script)
|
return bool(self.source_script)
|
||||||
|
|||||||
Reference in New Issue
Block a user