orphan project protection in job delete access

This commit is contained in:
AlanCoding
2016-07-20 10:21:38 -04:00
parent 53de76d6e0
commit fc96952084
2 changed files with 8 additions and 1 deletions
+2 -1
View File
@@ -1081,7 +1081,8 @@ class JobAccess(BaseAccess):
def can_delete(self, obj):
if obj.inventory is not None and self.user in obj.inventory.organization.admin_role:
return True
if obj.project is not None and self.user in obj.project.organization.admin_role:
if (obj.project is not None and obj.project.organization is not None and
self.user in obj.project.organization.admin_role):
return True
return False