Commit 2d7b4169 authored by ViolanteCodes's avatar ViolanteCodes
Browse files

added a public = False default call to gitlab_get_project to allow usage of...

added a public = False default call to gitlab_get_project to allow usage of the public API without retroactively breaking anything
parent 49ce1962
......@@ -217,12 +217,16 @@ def custom_ratelimit_post(
gl = gitlab.Gitlab(settings.GITLAB_URL, private_token=settings.GITLAB_SECRET_TOKEN)
gl_public = gitlab.Gitlab(settings.GITLAB_URL)
def gitlab_get_project(project, lazy=False):
def gitlab_get_project(project, lazy=False, public=False):
"""Takes an integer, and grabs a gitlab project where gitlab_id
matches the integer."""
working_project = gl.projects.get(project, lazy=lazy)
return working_project
if public == True:
working_project = gl_public.projects.get(project, lazy=lazy)
return working_project
else:
working_project = gl.projects.get(project, lazy=lazy)
return working_project
def gitlab_get_issue(project, issue, lazy_project = False, lazy_issue = False):
"""Takes two integers and grabs corresponding gitlab issue."""
working_project = gitlab_get_project(project, lazy=lazy_project)
......
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