Skip to content

Commit

Permalink
Merge pull request #50 from jhhaanstra/master
Browse files Browse the repository at this point in the history
Searching works
  • Loading branch information
TheElmo committed Jun 27, 2018
2 parents cde821e + 6ba3fbd commit 79f7c4c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,20 +327,20 @@ def search_courses(request):
author = course.user
unique = True
for returnCourse in returnData:
if course.id == returnCourse['id']:
if course.pk == returnCourse['id']:
unique = False
if unique:
returnData.append({
"id": course.id,
"name": course.name,
"description": course.description,
"image": course.image,
"subscribers": course.subscribers,
"author": author.name,
"trans_lang" : course.trans_lang,
"native_lang" : course.native_lang
'id' : course.pk,
'name' : course.name,
'description' : course.description,
'image' : course.image,
'subscribers' : course.subscribers,
'author' : author.name,
'trans_lang' : course.trans_lang.pk,
'native_lang' : course.native_lang.pk
})
return get_json_response(serializers.serialize('json', returnData))
return JsonResponse(returnData, safe=False)


# Lessons
Expand Down

0 comments on commit 79f7c4c

Please sign in to comment.