Changeset - 6754597990cb
[Not reviewed]
stable
0 2 0
Mads Kiilerich - 9 years ago 2016-05-30 15:33:19
madski@unity3d.com
api: fix forking of repos in repo groups (Issue #210)

Patch by Alexandre Beaulieu.
2 files changed with 7 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/api/api.py
Show inline comments
 
@@ -1672,15 +1672,16 @@ class ApiController(JSONRPCController):
 

	
 
        owner = get_user_or_error(owner)
 

	
 
        try:
 
            # create structure of groups and return the last group
 
            group = map_groups(fork_name)
 
            fork_base_name = fork_name.rsplit('/', 1)[-1]
 

	
 
            form_data = dict(
 
                repo_name=fork_name,
 
                repo_name=fork_base_name,
 
                repo_name_full=fork_name,
 
                repo_group=group,
 
                repo_type=repo.repo_type,
 
                description=Optional.extract(description),
 
                private=Optional.extract(private),
 
                copy_permissions=Optional.extract(copy_permissions),
kallithea/tests/api/api_base.py
Show inline comments
 
@@ -1388,14 +1388,17 @@ class _BaseTestApi(object):
 
            'task': None,
 
        }
 
        expected = ret
 
        self._compare_ok(id_, expected, given=response.body)
 
        fixture.destroy_repo(fork_name)
 

	
 
    def test_api_fork_repo_non_admin(self):
 
        fork_name = 'api-repo-fork'
 
    @parameterized.expand([
 
        (u'api-repo-fork',),
 
        (u'%s/api-repo-fork' % TEST_REPO_GROUP,),
 
    ])
 
    def test_api_fork_repo_non_admin(self, fork_name):
 
        id_, params = _build_data(self.apikey_regular, 'fork_repo',
 
                                  repoid=self.REPO,
 
                                  fork_name=fork_name,
 
        )
 
        response = api_call(self, params)
 

	
0 comments (0 inline, 0 general)