##// END OF EJS Templates
data checks
marcink -
r2444:b45e9fd7 codereview
parent child Browse files
Show More
@@ -68,6 +68,10 b' class CompareController(BaseRepoControll'
68 log.error('Could not found repo %s or %s' % (org_repo, other_repo))
68 log.error('Could not found repo %s or %s' % (org_repo, other_repo))
69 raise HTTPNotFound
69 raise HTTPNotFound
70
70
71 if c.org_repo.scm_instance.alias != 'hg':
72 log.error('Review not available for GIT REPOS')
73 raise HTTPNotFound
74
71 c.cs_ranges, discovery_data = PullRequestModel().get_compare_data(
75 c.cs_ranges, discovery_data = PullRequestModel().get_compare_data(
72 org_repo, org_ref, other_repo, other_ref
76 org_repo, org_ref, other_repo, other_ref
73 )
77 )
@@ -78,6 +78,11 b' class PullrequestsController(BaseRepoCon'
78
78
79 def index(self):
79 def index(self):
80 org_repo = c.rhodecode_db_repo
80 org_repo = c.rhodecode_db_repo
81
82 if org_repo.scm_instance.alias != 'hg':
83 log.error('Review not available for GIT REPOS')
84 raise HTTPNotFound
85
81 c.org_refs = self._get_repo_refs(c.rhodecode_repo)
86 c.org_refs = self._get_repo_refs(c.rhodecode_repo)
82 c.org_repos = []
87 c.org_repos = []
83 c.other_repos = []
88 c.other_repos = []
@@ -101,7 +106,6 b' class PullrequestsController(BaseRepoCon'
101 org_repo.parent.repo_name))
106 org_repo.parent.repo_name))
102 )
107 )
103
108
104 #TODO: maybe the owner should be default ?
105 c.review_members = []
109 c.review_members = []
106 c.available_members = []
110 c.available_members = []
107 for u in User.query().filter(User.username != 'default').all():
111 for u in User.query().filter(User.username != 'default').all():
@@ -192,6 +196,15 b' class PullrequestsController(BaseRepoCon'
192 c.users_groups_array = repo_model.get_users_groups_js()
196 c.users_groups_array = repo_model.get_users_groups_js()
193 c.pull_request = PullRequest.get(pull_request_id)
197 c.pull_request = PullRequest.get(pull_request_id)
194
198
199 # valid ID
200 if not c.pull_request:
201 raise HTTPNotFound
202
203 # pull_requests repo_name we opened it against
204 # ie. other_repo must match
205 if repo_name != c.pull_request.other_repo.repo_name:
206 raise HTTPNotFound
207
195 # load compare data into template context
208 # load compare data into template context
196 self._load_compare_data(c.pull_request)
209 self._load_compare_data(c.pull_request)
197
210
@@ -261,4 +274,4 b' class PullrequestsController(BaseRepoCon'
261 data.update({'rendered_text':
274 data.update({'rendered_text':
262 render('changeset/changeset_comment_block.html')})
275 render('changeset/changeset_comment_block.html')})
263
276
264 return data No newline at end of file
277 return data
General Comments 0
You need to be logged in to leave comments. Login now