From 0cb6f0652223d802763f32bada4fd229e4cfc405 Mon Sep 17 00:00:00 2001 From: Vivek Anand Date: Feb 09 2017 09:03:18 +0000 Subject: Add new exception: ProjectBlackListedException Signed-off-by: Vivek Anand --- diff --git a/pagure/exceptions.py b/pagure/exceptions.py index 80ee351..edcc943 100644 --- a/pagure/exceptions.py +++ b/pagure/exceptions.py @@ -23,6 +23,13 @@ class RepoExistsException(PagureException): pass +class ProjectBlackListedException(PagureException): + ''' Exception thrown when trying to create a repository but, that repository + name has been blacklisted + ''' + pass + + class FileNotFoundException(PagureException): ''' Exception thrown when trying to create a repository that already exists. diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 01ab8fa..4cd4610 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -1104,7 +1104,7 @@ def new_project(session, user, name, blacklist, allowed_prefix, ''' if name in blacklist or ( namespace and '%s/%s' % (namespace, name) in blacklist): - raise pagure.exceptions.RepoExistsException( + raise pagure.exceptions.ProjectBlackListedException( 'No project "%s" are allowed to be created due to potential ' 'conflicts in URLs with pagure itself' % name )