cleanup inventory admin access syntax

This commit is contained in:
AlanCoding 2016-11-07 11:56:11 -05:00
parent cae2cdaad8
commit 2afdc04ac0

View File

@ -537,11 +537,8 @@ class InventoryAccess(BaseAccess):
@check_superuser
def can_admin(self, obj, data):
# Verify that the user has access to the new organization if moving an
# inventory to a new organization.
if not self.check_related('organization', Organization, data, obj=obj):
return False
# Otherwise, just check for admin permission.
return self.user in obj.admin_role
# inventory to a new organization. Otherwise, just check for admin permission.
return self.check_related('organization', Organization, data, obj=obj) and self.user in obj.admin_role
def can_delete(self, obj):
is_can_admin = self.can_admin(obj, None)