Mercurial > kallithea
diff rhodecode/model/db.py @ 3239:a9565b8b429b beta
filter out repo groups choices to only ones that you have write+ access to. Before it was read+ access and you got proper
error saying that you don't have write permissions to group to create repo in. Filtering out the read groups is less confusing for users.
ref #730
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Mon, 28 Jan 2013 00:02:09 +0100 |
parents | 21cccfea18bf |
children | b9ba0d4d3abf |
line wrap: on
line diff
--- a/rhodecode/model/db.py Sun Jan 27 22:37:55 2013 +0100 +++ b/rhodecode/model/db.py Mon Jan 28 00:02:09 2013 +0100 @@ -1177,15 +1177,11 @@ self.group_name) @classmethod - def groups_choices(cls, groups=None, check_perms=False, show_empty_group=True): + def groups_choices(cls, groups=None, show_empty_group=True): from webhelpers.html import literal as _literal - from rhodecode.model.scm import ScmModel if not groups: groups = cls.query().all() - if check_perms: - #filter group user have access to, it's done - #magically inside ScmModel based on current user - groups = ScmModel().get_repos_groups(groups) + repo_groups = [] if show_empty_group: repo_groups = [('-1', '-- no parent --')]