# HG changeset patch # User Mads Kiilerich # Date 2015-08-26 17:28:59 # Node ID b9c9216d6fa77d401410e1ec8f1789a108145b21 # Parent 68011c4e6f33c6485740218e4d528ac452264e7f pull requests: make owner editable with auto completion diff --git a/kallithea/controllers/pullrequests.py b/kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py +++ b/kallithea/controllers/pullrequests.py @@ -61,6 +61,7 @@ from kallithea.lib.utils2 import safe_in from kallithea.controllers.changeset import _ignorews_url, _context_url from kallithea.controllers.compare import CompareController from kallithea.lib.graphmod import graph_data +from kallithea.model.db import User ### FIXME log = logging.getLogger(__name__) @@ -497,6 +498,7 @@ class PullrequestsController(BaseRepoCon old_description = pull_request.description pull_request.title = _form['pullrequest_title'] pull_request.description = _form['pullrequest_desc'].strip() or _('No description') + pull_request.owner = User.get_by_username(_form['owner']) try: PullRequestModel().mention_from_description(pull_request, old_description) PullRequestModel().update_reviewers(pull_request_id, reviewers_ids) diff --git a/kallithea/model/forms.py b/kallithea/model/forms.py --- a/kallithea/model/forms.py +++ b/kallithea/model/forms.py @@ -518,6 +518,8 @@ def PullRequestPostForm(): pullrequest_desc = v.UnicodeString(strip=True, required=False) review_members = v.Set() updaterev = v.UnicodeString(strip=True, required=False, if_missing=None) + owner = All(v.UnicodeString(strip=True, required=True), + v.ValidRepoUser()) return _PullRequestPostForm diff --git a/kallithea/templates/pullrequests/pullrequest_show.html b/kallithea/templates/pullrequests/pullrequest_show.html --- a/kallithea/templates/pullrequests/pullrequest_show.html +++ b/kallithea/templates/pullrequests/pullrequest_show.html @@ -38,7 +38,7 @@ ${self.repo_context_bar('showpullrequest %if editable:
- ${_("Edit")} + ${_("Edit")}
%endif @@ -48,7 +48,7 @@ ${self.repo_context_bar('showpullrequest %if editable: -