From e8c0a8355f5e83d3d7e080443a92e4f2e3a131a1 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Thu, 7 Jan 2016 14:34:19 -0500 Subject: [PATCH] only check repo usage when billing enabled --- endpoints/api/repository.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/endpoints/api/repository.py b/endpoints/api/repository.py index 851bd644d..0a57e10d6 100644 --- a/endpoints/api/repository.py +++ b/endpoints/api/repository.py @@ -331,8 +331,9 @@ class Repository(RepositoryParamResource): """ Delete a repository. """ model.repository.purge_repository(namespace, repository) user = model.user.get_namespace_user(namespace) - plan = get_namespace_plan(namespace) - check_repository_usage(user, plan) + if features.BILLING: + plan = get_namespace_plan(namespace) + check_repository_usage(user, plan) log_action('delete_repo', namespace, {'repo': repository, 'namespace': namespace}) return 'Deleted', 204