diff rhodecode/model/forms.py @ 1022:4f834b0abcd3 beta

Code refactor number 2
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 11 Feb 2011 00:13:09 +0100
parents 65129c332d37
children 6d0a7284949d
line wrap: on
line diff
--- a/rhodecode/model/forms.py	Fri Feb 11 00:12:27 2011 +0100
+++ b/rhodecode/model/forms.py	Fri Feb 11 00:13:09 2011 +0100
@@ -29,8 +29,9 @@
     Email, Bool, StringBoolean, Set
 
 from pylons.i18n.translation import _
+from webhelpers.pylonslib.secure_form import authentication_token
 
-import rhodecode.lib.helpers as h
+from rhodecode.lib.utils import repo_name_slug
 from rhodecode.lib.auth import authenticate, get_crypt_password
 from rhodecode.lib.exceptions import LdapImportError
 from rhodecode.model import meta
@@ -40,8 +41,6 @@
 from rhodecode.model.db import User, UsersGroup
 from rhodecode import BACKENDS
 
-from webhelpers.pylonslib.secure_form import authentication_token
-
 log = logging.getLogger(__name__)
 
 #this is needed to translate the messages using _() in validators
@@ -214,7 +213,7 @@
     class _ValidRepoName(formencode.validators.FancyValidator):
 
         def to_python(self, value, state):
-            slug = h.repo_name_slug(value)
+            slug = repo_name_slug(value)
             if slug in ['_admin']:
                 raise formencode.Invalid(_('This repository name is disallowed'),
                                          value, state)