fix thread/thread id issue

This commit is contained in:
Kevin Chugh
2013-03-13 09:02:57 -04:00
parent 8280c55992
commit 07534a7231
2 changed files with 4 additions and 2 deletions

View File

@@ -295,13 +295,13 @@ def undo_vote_for_thread(request, course_id, thread_id):
def pin_thread(request, course_id, thread_id):
user = cc.User.from_django_user(request.user)
thread = cc.Thread.find(thread_id)
thread.pin(user,thread)
thread.pin(user,thread_id)
return JsonResponse(utils.safe_content(thread.to_dict()))
def un_pin_thread(request, course_id, thread_id):
user = cc.User.from_django_user(request.user)
thread = cc.Thread.find(thread_id)
thread.un_pin(user,thread)
thread.un_pin(user,thread_id)
return JsonResponse(utils.safe_content(thread.to_dict()))

View File

@@ -84,6 +84,8 @@ class Thread(models.Model):
url = _url_for_pin_thread(thread_id)
params = {'user_id': user.id}
request = perform_request('put', url, params)
print "\n\n\n\n\n\n*******************"
print request
self.update_attributes(request)
def un_pin(self, user, thread_id):