# HG changeset patch # User Mads Kiilerich # Date 1408657615 -7200 # Node ID 3d968d66c9b9312917796e2da91a6ef45d36885b # Parent 43cafe348c9ad519ba3938b0b19ec68219333daf pull requests: use verbose URLs in as many places as possible - they are helpful diff -r 43cafe348c9a -r 3d968d66c9b9 kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py Thu Aug 21 23:46:55 2014 +0200 +++ b/kallithea/controllers/pullrequests.py Thu Aug 21 23:46:55 2014 +0200 @@ -554,8 +554,7 @@ h.flash(_('Error occurred while creating pull request'), category='error') log.error(traceback.format_exc()) - return redirect(url('pullrequest_show', repo_name=repo_name, - pull_request_id=pull_request_id)) + return redirect(old_pull_request.url()) ChangesetCommentsModel().create( text=_('Closed, replaced by %s .') % h.canonical_url('pullrequest_show', @@ -571,8 +570,7 @@ h.flash(_('Pull request update created'), category='success') - return redirect(url('pullrequest_show', repo_name=old_pull_request.other_repo.repo_name, - pull_request_id=pull_request.pull_request_id)) + return redirect(pull_request.url()) # pullrequest_post for PR editing @LoginRequired() @@ -594,8 +592,7 @@ Session().commit() h.flash(_('Pull request updated'), category='success') - return redirect(url('pullrequest_show', repo_name=repo.repo_name, - pull_request_id=pull_request_id)) + return redirect(pull_request.url()) # pullrequest_update for updating reviewer list @LoginRequired() @@ -733,8 +730,7 @@ Session().commit() if not request.environ.get('HTTP_X_PARTIAL_XHR'): - return redirect(h.url('pullrequest_show', repo_name=repo_name, - pull_request_id=pull_request_id)) + return redirect(pull_request.url()) data = { 'target_id': h.safeid(h.safe_unicode(request.POST.get('f_path'))), diff -r 43cafe348c9a -r 3d968d66c9b9 kallithea/model/db.py --- a/kallithea/model/db.py Thu Aug 21 23:46:55 2014 +0200 +++ b/kallithea/model/db.py Thu Aug 21 23:46:55 2014 +0200 @@ -2311,7 +2311,7 @@ import kallithea.lib.helpers as h s = '/' + self.title b = self.org_ref_parts[1] - if b not in s and b != self.other_ref_parts[1]: + if b != self.other_ref_parts[1]: s = '/_%s_%s' % (b, s) kwargs['extra'] = urlreadable(s) if canonical: