# HG changeset patch # User Marcin Kuzminski # Date 1318035626 -7200 # Node ID c0e6057543ff906f4eb23b79a41d990b7999f832 # Parent 2afe9320d5e68ce583ca8a7503fd10d349e35ac9 fixed hardcoded admin prefix check in forms diff -r 2afe9320d5e6 -r c0e6057543ff rhodecode/model/forms.py --- a/rhodecode/model/forms.py Sat Oct 08 03:00:03 2011 +0200 +++ b/rhodecode/model/forms.py Sat Oct 08 03:00:26 2011 +0200 @@ -32,6 +32,7 @@ from pylons.i18n.translation import _ from webhelpers.pylonslib.secure_form import authentication_token +from rhodecode.config.routing import ADMIN_PREFIX from rhodecode.lib.utils import repo_name_slug from rhodecode.lib.auth import authenticate, get_crypt_password from rhodecode.lib.exceptions import LdapImportError @@ -240,7 +241,7 @@ repo_name = value.get('repo_name') slug = repo_name_slug(repo_name) - if slug in ['_admin', '']: + if slug in [ADMIN_PREFIX, '']: e_dict = {'repo_name': _('This repository name is disallowed')} raise formencode.Invalid('', value, state, error_dict=e_dict) @@ -286,7 +287,7 @@ repo_name = value.get('fork_name') slug = repo_name_slug(repo_name) - if slug in ['_admin', '']: + if slug in [ADMIN_PREFIX, '']: e_dict = {'repo_name': _('This repository name is disallowed')} raise formencode.Invalid('', value, state, error_dict=e_dict)