# HG changeset patch # User Marcin Kuzminski # Date 2010-06-29 10:32:30 # Node ID fc4027fe46bc7ece39d7ae5fea2fb281721b12ef # Parent 7e4771a0ff43f0cd86b8fe33d327869ea3188fa4 fixed bug when user is capable of creating _admin repository which is a link to admin interface diff --git a/pylons_app/model/forms.py b/pylons_app/model/forms.py --- a/pylons_app/model/forms.py +++ b/pylons_app/model/forms.py @@ -138,7 +138,9 @@ def ValidRepoName(edit=False): def to_python(self, value, state): slug = h.repo_name_slug(value) - + if slug in ['_admin']: + raise formencode.Invalid(_('This repository name is disallowed'), + value, state) sa = meta.Session if sa.query(Repository).get(slug) and not edit: raise formencode.Invalid(_('This repository already exists'),