From 3a37fa5dae249996ae0f7d6f00644e74c543c888 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 13 2017 13:25:11 +0000 Subject: Only check the blacklist if there is no namespace It only makes sense to check the black list if there is no namespace attached to the project as otherwise there is no risk of URL conflict then. --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 8c3c503..6731d21 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -1197,8 +1197,8 @@ def new_project(session, user, name, blacklist, allowed_prefix, ignore_existing_repo=False): ''' Create a new project based on the information provided. ''' - if name in blacklist or ( - namespace and '%s/%s' % (namespace, name) in blacklist): + if (not namespace and name in blacklist) \ + or (namespace and '%s/%s' % (namespace, name) in blacklist): raise pagure.exceptions.ProjectBlackListedException( 'No project "%s" are allowed to be created due to potential ' 'conflicts in URLs with pagure itself' % name