##// END OF EJS Templates
pull-requests: allow filter by author
marcink -
r4320:d3b91086 default
parent child Browse files
Show More
@@ -54,7 +54,7 b' from rhodecode.model.changeset_status im'
54 from rhodecode.model.comment import CommentsModel
54 from rhodecode.model.comment import CommentsModel
55 from rhodecode.model.db import (
55 from rhodecode.model.db import (
56 or_, String, cast, PullRequest, PullRequestReviewers, ChangesetStatus,
56 or_, String, cast, PullRequest, PullRequestReviewers, ChangesetStatus,
57 PullRequestVersion, ChangesetComment, Repository, RepoReviewRule)
57 PullRequestVersion, ChangesetComment, Repository, RepoReviewRule, User)
58 from rhodecode.model.meta import Session
58 from rhodecode.model.meta import Session
59 from rhodecode.model.notification import NotificationModel, \
59 from rhodecode.model.notification import NotificationModel, \
60 EmailNotificationModel
60 EmailNotificationModel
@@ -160,8 +160,10 b' class PullRequestModel(BaseModel):'
160
160
161 if search_q:
161 if search_q:
162 like_expression = u'%{}%'.format(safe_unicode(search_q))
162 like_expression = u'%{}%'.format(safe_unicode(search_q))
163 q = q.join(User)
163 q = q.filter(or_(
164 q = q.filter(or_(
164 cast(PullRequest.pull_request_id, String).ilike(like_expression),
165 cast(PullRequest.pull_request_id, String).ilike(like_expression),
166 User.username.ilike(like_expression),
165 PullRequest.title.ilike(like_expression),
167 PullRequest.title.ilike(like_expression),
166 PullRequest.description.ilike(like_expression),
168 PullRequest.description.ilike(like_expression),
167 ))
169 ))
@@ -374,8 +376,10 b' class PullRequestModel(BaseModel):'
374
376
375 if query:
377 if query:
376 like_expression = u'%{}%'.format(safe_unicode(query))
378 like_expression = u'%{}%'.format(safe_unicode(query))
379 q = q.join(User)
377 q = q.filter(or_(
380 q = q.filter(or_(
378 cast(PullRequest.pull_request_id, String).ilike(like_expression),
381 cast(PullRequest.pull_request_id, String).ilike(like_expression),
382 User.username.ilike(like_expression),
379 PullRequest.title.ilike(like_expression),
383 PullRequest.title.ilike(like_expression),
380 PullRequest.description.ilike(like_expression),
384 PullRequest.description.ilike(like_expression),
381 ))
385 ))
General Comments 0
You need to be logged in to leave comments. Login now