diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 74398cf..c84d04b 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -1000,7 +1000,7 @@ def new_project(session, user, name, blacklist, allowed_prefix, 'of a group that you are part of.' ) - if len(second_part) == 40 and not prevent_40_chars: + if len(second_part) == 40 and prevent_40_chars: # We must block project with a name / where the length # of is exactly 40 characters long as this would otherwise # conflict with the old URL schema used for commit that was diff --git a/tests/test_pagure_lib.py b/tests/test_pagure_lib.py index c0037df..f233651 100644 --- a/tests/test_pagure_lib.py +++ b/tests/test_pagure_lib.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ - (c) 2015 - Copyright Red Hat Inc + (c) 2015-2016 - Copyright Red Hat Inc Authors: Pierre-Yves Chibon @@ -764,6 +764,7 @@ class PagureLibtests(tests.Modeltests): requestfolder=requestfolder, description='description for 40 chars length project', parent_id=None, + prevent_40_chars=True, ) # Create a new project @@ -902,7 +903,6 @@ class PagureLibtests(tests.Modeltests): requestfolder=requestfolder, description='description for 40 chars length project', parent_id=None, - prevent_40_chars=True, ) self.session.commit() self.assertEqual(