repo-group-model: add flag to return proper object along the exported names.

This commit is contained in:
Marcin Kuzminski 2016-11-23 17:32:57 +01:00
parent 2a8b58692d
commit 61fd73e695

View file

@ -126,7 +126,8 @@ class RepoGroupModel(BaseModel):
repo_group_to_perm.user_id = def_user.user_id
return repo_group_to_perm
def _get_group_name_and_parent(self, group_name_full, repo_in_path=False):
def _get_group_name_and_parent(self, group_name_full, repo_in_path=False,
get_object=False):
"""
Get's the group name and a parent group name from given group name.
If repo_in_path is set to truth, we asume the full path also includes
@ -148,9 +149,13 @@ class RepoGroupModel(BaseModel):
if len(_parts) > 1:
parent_repo_group_name = _parts[0]
parent_group = None
if parent_repo_group_name:
parent_group = RepoGroup.get_by_group_name(parent_repo_group_name)
if get_object:
return group_name_cleaned, parent_repo_group_name, parent_group
return group_name_cleaned, parent_repo_group_name
def check_exist_filesystem(self, group_name, exc_on_failure=True):