# HG changeset patch # User Mads Kiilerich # Date 1437605549 -7200 # Node ID 2f794e9061f5c4fb4133988322ea82fd5416d95d # Parent bd2ca76af903a867fb17a728166540a1ba34351f repogroup: after creating a repogroup, redirect to it diff -r bd2ca76af903 -r 2f794e9061f5 kallithea/controllers/admin/repo_groups.py --- a/kallithea/controllers/admin/repo_groups.py Thu Jul 23 00:52:29 2015 +0200 +++ b/kallithea/controllers/admin/repo_groups.py Thu Jul 23 00:52:29 2015 +0200 @@ -172,16 +172,14 @@ map(lambda k: k[0], c.repo_groups))() try: form_result = repo_group_form.to_python(dict(request.POST)) - RepoGroupModel().create( + gr = RepoGroupModel().create( group_name=form_result['group_name'], group_description=form_result['group_description'], parent=form_result['group_parent_id'], - owner=self.authuser.user_id, + owner=self.authuser.user_id, # TODO: make editable copy_permissions=form_result['group_copy_permissions'] ) Session().commit() - h.flash(_('Created repository group %s') \ - % form_result['group_name'], category='success') #TODO: in futureaction_logger(, '', '', '', self.sa) except formencode.Invalid, errors: return htmlfill.render( @@ -195,9 +193,12 @@ log.error(traceback.format_exc()) h.flash(_('Error occurred during creation of repository group %s') \ % request.POST.get('group_name'), category='error') - parent_group_id = form_result['group_parent_id'] - #TODO: maybe we should get back to the main view, not the admin one - return redirect(url('repos_groups', parent_group=parent_group_id)) + parent_group_id = form_result['group_parent_id'] + #TODO: maybe we should get back to the main view, not the admin one + return redirect(url('repos_groups', parent_group=parent_group_id)) + h.flash(_('Created repository group %s') % gr.group_name, + category='success') + return redirect(url('repos_group_home', group_name=gr.group_name)) def new(self): """GET /repo_groups/new: Form to create a new item"""