Added tests for post conditional logic

This commit is contained in:
Wayne Witzel III
2017-05-11 15:31:39 -04:00
parent aff084e1f6
commit 54876e71e7
2 changed files with 37 additions and 1 deletions

View File

@@ -2333,7 +2333,7 @@ class InventoryInventorySourcesUpdate(RetrieveAPIView):
project_update = False
if inventory_source.source == 'scm' and inventory_source.update_on_project_update:
if not self.request.user or not self.request.user.can_access(Project, 'start', inventory_source.source_project):
if not request.user or not request.user.can_access(Project, 'start', inventory_source.source_project):
details['status'] = 'You do not have permission to update project `{}`'.format(inventory_source.source_project.name)
can_update = False
else: