Browse Source

Rename the project variable to avoid variable shadowing

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Pierre-Yves Chibon 4 years ago
parent
commit
3b6928e366
1 changed files with 6 additions and 6 deletions
  1. 6 6
      pagure/ui/clone.py

+ 6 - 6
pagure/ui/clone.py

@@ -389,14 +389,14 @@ def clone_proxy(project, username=None, namespace=None):
             )
             flask.abort(response)
 
-    project = pagure.lib.query.get_authorized_project(
+    project_obj = pagure.lib.query.get_authorized_project(
         flask.g.session,
         project,
         user=username,
         namespace=namespace,
         asuser=remote_user,
     )
-    if not project:
+    if not project_obj:
         _auth_log.info(
             "User asked to access a git repo that they are not allowed to "
             "access -- |user: %s|IP: %s|method: %s|repo: %s|query: %s"
@@ -404,7 +404,7 @@ def clone_proxy(project, username=None, namespace=None):
                 remote_user,
                 flask.request.remote_addr,
                 flask.request.method,
-                p1.path,
+                p1_path,
                 flask.request.query_string,
             )
         )
@@ -417,10 +417,10 @@ def clone_proxy(project, username=None, namespace=None):
         )
         flask.abort(404, description="Project not found")
 
-    if project.is_on_repospanner:
-        return proxy_repospanner(project, service)
+    if project_obj.is_on_repospanner:
+        return proxy_repospanner(project_obj, service)
     else:
-        return proxy_raw_git(project)
+        return proxy_raw_git(project_obj)
 
 
 def add_clone_proxy_cmds():