##// END OF EJS Templates
possible fix for #486 undefined variable username...
marcink -
r2500:94ef0b60 beta
parent child Browse files
Show More
@@ -167,7 +167,6 b' class SimpleGit(BaseVCSController):'
167 #==============================================================
167 #==============================================================
168 # CHECK PERMISSIONS FOR THIS REQUEST USING GIVEN USERNAME
168 # CHECK PERMISSIONS FOR THIS REQUEST USING GIVEN USERNAME
169 #==============================================================
169 #==============================================================
170 if action in ['pull', 'push']:
171 try:
170 try:
172 user = self.__get_user(username)
171 user = self.__get_user(username)
173 if user is None or not user.active:
172 if user is None or not user.active:
@@ -175,13 +174,13 b' class SimpleGit(BaseVCSController):'
175 username = user.username
174 username = user.username
176 except:
175 except:
177 log.error(traceback.format_exc())
176 log.error(traceback.format_exc())
178 return HTTPInternalServerError()(environ,
177 return HTTPInternalServerError()(environ, start_response)
179 start_response)
180
178
181 #check permissions for this repository
179 #check permissions for this repository
182 perm = self._check_permission(action, user, repo_name)
180 perm = self._check_permission(action, user, repo_name)
183 if perm is not True:
181 if perm is not True:
184 return HTTPForbidden()(environ, start_response)
182 return HTTPForbidden()(environ, start_response)
183
185 extras = {
184 extras = {
186 'ip': ipaddr,
185 'ip': ipaddr,
187 'username': username,
186 'username': username,
@@ -70,7 +70,7 b' class SimpleHg(BaseVCSController):'
70 return self.application(environ, start_response)
70 return self.application(environ, start_response)
71
71
72 ipaddr = self._get_ip_addr(environ)
72 ipaddr = self._get_ip_addr(environ)
73
73 username = None
74 # skip passing error to error controller
74 # skip passing error to error controller
75 environ['pylons.status_code_redirect'] = True
75 environ['pylons.status_code_redirect'] = True
76
76
@@ -131,7 +131,6 b' class SimpleHg(BaseVCSController):'
131 #==============================================================
131 #==============================================================
132 # CHECK PERMISSIONS FOR THIS REQUEST USING GIVEN USERNAME
132 # CHECK PERMISSIONS FOR THIS REQUEST USING GIVEN USERNAME
133 #==============================================================
133 #==============================================================
134 if action in ['pull', 'push']:
135 try:
134 try:
136 user = self.__get_user(username)
135 user = self.__get_user(username)
137 if user is None or not user.active:
136 if user is None or not user.active:
@@ -139,8 +138,7 b' class SimpleHg(BaseVCSController):'
139 username = user.username
138 username = user.username
140 except:
139 except:
141 log.error(traceback.format_exc())
140 log.error(traceback.format_exc())
142 return HTTPInternalServerError()(environ,
141 return HTTPInternalServerError()(environ, start_response)
143 start_response)
144
142
145 #check permissions for this repository
143 #check permissions for this repository
146 perm = self._check_permission(action, user, repo_name)
144 perm = self._check_permission(action, user, repo_name)
General Comments 0
You need to be logged in to leave comments. Login now