only check repo usage when billing enabled

This commit is contained in:
Jimmy Zelinskie 2016-01-07 14:34:19 -05:00
parent 6f2a8b00f2
commit e8c0a8355f

View file

@ -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