added project data from github to GET function
This commit is contained in:
parent
5b87b0a4d0
commit
bd224fb7d8
1 changed files with 4 additions and 1 deletions
|
@ -174,6 +174,7 @@ def getProjectsByCourse(token, courseId):
|
|||
|
||||
if get_user_by_token(token) is None:
|
||||
return bad_request("Bad User Token")
|
||||
|
||||
arr = []
|
||||
query = Project.all()
|
||||
query.filter("courseId = ", int(courseId))
|
||||
|
@ -233,7 +234,9 @@ def getProjectsByUser(token):
|
|||
arr = []
|
||||
for p in user.projects_id_list:
|
||||
project = Project.get_by_id(int(p))
|
||||
arr.append(dict(json.loads(project.to_JSON())))
|
||||
projDict = dict(json.loads(project.to_JSON()))
|
||||
projDict['info'] = get_github_data(project.gitRepository)
|
||||
arr.append(projDict)
|
||||
|
||||
if len(arr) != 0:
|
||||
return Response(response=json.dumps(arr),
|
||||
|
|
Loading…
Reference in a new issue