Commit c595639c authored by ViolanteCodes's avatar ViolanteCodes
Browse files

changed project detail view to call public api vs private token API

parent 2d7b4169
......@@ -227,9 +227,9 @@ def gitlab_get_project(project, lazy=False, public=False):
working_project = gl.projects.get(project, lazy=lazy)
return working_project
def gitlab_get_issue(project, issue, lazy_project = False, lazy_issue = False):
def gitlab_get_issue(project, issue, lazy_project=False, lazy_issue=False, public=False):
"""Takes two integers and grabs corresponding gitlab issue."""
working_project = gitlab_get_project(project, lazy=lazy_project)
working_project = gitlab_get_project(project, lazy=lazy_project, public=public)
working_issue = working_project.issues.get(issue, lazy=lazy_issue)
return working_issue
......@@ -474,7 +474,7 @@ class ProjectDetailView(DetailView):
# Grab the gitlab ID from db and create GL project object with
# a lazy API call.
gitlab_id = db_project.gitlab_id
gl_project = gitlab_get_project(gitlab_id, lazy=True)
gl_project = gitlab_get_project(gitlab_id, lazy=True, public=True)
# Save the project attributes to context dict.
context['results'] = {'user_identifier': user_identifier}
context['page_number'] = page_number
......@@ -742,7 +742,7 @@ def issue_detail_view(request, user_identifier, project_slug, gitlab_iid, go_bac
# Use the gitlab_id from database project to fetch project from gitlab.
# (Increases security.)
gitlab_id = database_project.gitlab_id
working_project = gitlab_get_project(project=gitlab_id)
working_project = gitlab_get_project(project=gitlab_id, public=True)
results['project'] = working_project.attributes
go_back_url = reverse('project-detail', args=[user_identifier, project_slug, go_back_number])
results['go_back_url'] = go_back_url
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment