Show More
@@ -76,6 +76,7 b' class RepoGroupsController(base.BaseCont' | |||
|
76 | 76 | repo_group = db.RepoGroup.get_or_404(group_id) |
|
77 | 77 | data = repo_group.get_dict() |
|
78 | 78 | data['group_name'] = repo_group.name |
|
79 | data['owner'] = repo_group.owner.username | |
|
79 | 80 | |
|
80 | 81 | # fill repository group users |
|
81 | 82 | for p in repo_group.repo_group_to_perm: |
@@ -146,7 +147,7 b' class RepoGroupsController(base.BaseCont' | |||
|
146 | 147 | group_name=form_result['group_name'], |
|
147 | 148 | group_description=form_result['group_description'], |
|
148 | 149 | parent=form_result['parent_group_id'], |
|
149 |
owner=request.authuser.user_id, |
|
|
150 | owner=request.authuser.user_id, | |
|
150 | 151 | copy_permissions=form_result['group_copy_permissions'] |
|
151 | 152 | ) |
|
152 | 153 | meta.Session().commit() |
@@ -173,6 +173,7 b' def RepoGroupForm(edit=False, old_data=N' | |||
|
173 | 173 | group_copy_permissions = v.StringBoolean(if_missing=False) |
|
174 | 174 | |
|
175 | 175 | if edit: |
|
176 | owner = All(v.UnicodeString(not_empty=True), v.ValidRepoUser()) | |
|
176 | 177 | # FIXME: do a special check that we cannot move a group to one of |
|
177 | 178 | # its children |
|
178 | 179 | pass |
@@ -281,6 +281,8 b' class RepoGroupModel(object):' | |||
|
281 | 281 | old_path = repo_group.full_path |
|
282 | 282 | |
|
283 | 283 | # change properties |
|
284 | if 'owner' in repo_group_args: | |
|
285 | repo_group.owner = db.User.get_by_username(repo_group_args['owner']) | |
|
284 | 286 | if 'group_description' in repo_group_args: |
|
285 | 287 | repo_group.group_description = repo_group_args['group_description'] |
|
286 | 288 | if 'parent_group_id' in repo_group_args: |
@@ -9,6 +9,13 b'' | |||
|
9 | 9 | </div> |
|
10 | 10 | |
|
11 | 11 | <div class="form-group"> |
|
12 | <label class="control-label" for="owner">${_('Owner')}:</label> | |
|
13 | <div> | |
|
14 | ${h.text('owner',class_='form-control', placeholder=_('Type name of user'))} | |
|
15 | </div> | |
|
16 | </div> | |
|
17 | ||
|
18 | <div class="form-group"> | |
|
12 | 19 | <label class="control-label" for="group_description">${_('Description')}:</label> |
|
13 | 20 | <div> |
|
14 | 21 | ${h.textarea('group_description',cols=23,rows=5,class_='form-control')} |
@@ -47,5 +54,6 b'' | |||
|
47 | 54 | $("#parent_group_id").select2({ |
|
48 | 55 | 'dropdownAutoWidth': true |
|
49 | 56 | }); |
|
57 | SimpleUserAutoComplete($('#owner')); | |
|
50 | 58 | }); |
|
51 | 59 | </script> |
@@ -1851,7 +1851,7 b' class _BaseTestApi(object):' | |||
|
1851 | 1851 | self._compare_error(id_, expected, given=response.body) |
|
1852 | 1852 | |
|
1853 | 1853 | @base.parametrize('changing_attr,updates', [ |
|
1854 |
|
|
|
1854 | ('owner', {'owner': base.TEST_USER_REGULAR_LOGIN}), | |
|
1855 | 1855 | ('description', {'description': 'new description'}), |
|
1856 | 1856 | ('group_name', {'group_name': 'new_repo_name'}), |
|
1857 | 1857 | ('parent', {'parent': 'test_group_for_update'}), |
@@ -53,6 +53,7 b' class TestRepoGroupsController(base.Test' | |||
|
53 | 53 | # edit |
|
54 | 54 | response = self.app.post(base.url('update_repos_group', group_name=group_name), |
|
55 | 55 | {'group_name': group_name, |
|
56 | 'owner': base.TEST_USER_REGULAR2_LOGIN, | |
|
56 | 57 | 'group_description': 'lolo', |
|
57 | 58 | '_session_csrf_secret_token': self.session_csrf_secret_token()}) |
|
58 | 59 | self.checkSessionFlash(response, 'Updated repository group %s' % group_name) |
General Comments 0
You need to be logged in to leave comments.
Login now