diff --git a/kallithea/model/db.py b/kallithea/model/db.py --- a/kallithea/model/db.py +++ b/kallithea/model/db.py @@ -1519,16 +1519,10 @@ class RepoGroup(Base, BaseModel): return repo_group.group_id, literal(cls.SEP.join(repo_group.full_path_splitted)) @classmethod - def groups_choices(cls, groups, show_empty_group=True): + def groups_choices(cls, groups): """Return tuples with group_id and name as html literal.""" - - if show_empty_group: - groups = list(groups) - groups.append(None) - - choices = [cls._generate_choice(g) for g in groups] - - return sorted(choices, key=lambda c: c[1].split(cls.SEP)) + return sorted((cls._generate_choice(g) for g in groups), + key=lambda c: c[1].split(cls.SEP)) @classmethod def url_sep(cls): diff --git a/kallithea/model/scm.py b/kallithea/model/scm.py --- a/kallithea/model/scm.py +++ b/kallithea/model/scm.py @@ -901,4 +901,4 @@ def AvailableRepoGroupChoices(top_perms, for extra in extras: if not any(rg == extra for rg in groups): groups.append(extra) - return RepoGroup.groups_choices(groups=groups, show_empty_group=False) + return RepoGroup.groups_choices(groups=groups)