diff options
author | Marcin Kuzminski <marcin@python-works.com> | 2011-10-08 03:00:26 +0200 |
---|---|---|
committer | Marcin Kuzminski <marcin@python-works.com> | 2011-10-08 03:00:26 +0200 |
commit | a1e917b7680f8282c089b96eb4b5adbb83c25761 (patch) | |
tree | bf7848bab53cfc62e3d8c9d80f5b7832196b76f1 /rhodecode/model/forms.py | |
parent | 7a91b07ef61fd5ab6c9e53b2a575bf81bc6d1689 (diff) |
fixed hardcoded admin prefix check in forms
--HG--
branch : beta
Diffstat (limited to 'rhodecode/model/forms.py')
-rw-r--r-- | rhodecode/model/forms.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rhodecode/model/forms.py b/rhodecode/model/forms.py index 61553fec..69e544f1 100644 --- a/rhodecode/model/forms.py +++ b/rhodecode/model/forms.py @@ -32,6 +32,7 @@ from formencode.validators import UnicodeString, OneOf, Int, Number, Regex, \ 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 @@ def ValidRepoName(edit, old_data): 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 @@ def ValidForkName(): 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) |