Fix reference to quotas
@@ -2646,7 +2646,7 @@ class UserAccess(models.Model):
if grantee_priv == PrivilegeCodes.OWNER and this_privilege != PrivilegeCodes.OWNER:
if access_resource.owners.count() == 1:
raise PermissionDenied("Cannot remove sole owner of resource")
- qholder = access_resource.get_quota_holder()
+ qholder = this_resource.get_quota_holder()
if qholder:
if qholder == user:
raise PermissionDenied("Cannot remove this resource's quota holder from "
@@ -3019,7 +3019,7 @@ class UserAccess(models.Model):
raise PermissionDenied("Requesting user is not active")
access_resource = this_resource.raccess
- qholder = access_resource.get_quota_holder()
+ qholder = this_resource.get_quota_holder()
if self.user.is_superuser or self.owns_resource(this_resource):
# everyone who holds this resource, minus potential sole owners
if access_resource.owners.count() == 1:
