From d1352611830d2ec5c70a93c1615944862623fe73 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 15 2016 13:10:33 +0000 Subject: Drop the user's username from the list of allowed prefix in project names Pagure is not meant to be a new github or so. --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index bba7104..f777d21 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -964,12 +964,14 @@ def new_project(session, user, name, blacklist, allowed_prefix, ) user_obj = __get_user(session, user) - allowed_prefix = allowed_prefix + [user] + [grp.name for grp in user_obj.groups] + allowed_prefix = allowed_prefix + [grp.name for grp in user_obj.groups] first_part, _, second_part = name.partition('/') if second_part and first_part not in allowed_prefix: raise pagure.exceptions.PagureException( - 'The prefix of you project must be in `%s`.' % allowed_prefix + 'The prefix of you project must be in the list of allowed ' + 'prefix set by the admins of this pagure instance, or the name ' + 'of a group that you are part of.' ) if len(second_part) == 40: raise pagure.exceptions.PagureException(