From 63349dab9c556f52bac5536c4ea89c0daaebcf2a Mon Sep 17 00:00:00 2001 From: Arthur Barrett Date: Mon, 25 Mar 2013 19:04:23 -0400 Subject: [PATCH] fixed update/delete responses --- lms/djangoapps/notes/api.py | 11 +++++++---- lms/static/coffee/src/notes.coffee | 1 - 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lms/djangoapps/notes/api.py b/lms/djangoapps/notes/api.py index b0ee45c890..fb52683a27 100644 --- a/lms/djangoapps/notes/api.py +++ b/lms/djangoapps/notes/api.py @@ -105,7 +105,7 @@ def read(request, course_id, note_id): def update(request, course_id, note_id): try: - note = Note.objects.get(note_id) + note = Note.objects.get(id=note_id) except: return [HttpResponse('', status=404), None] @@ -118,13 +118,16 @@ def update(request, course_id, note_id): log.debug(e) return [HttpResponse('', status=500), None] - note.save(update_fields=['text', 'tags', 'updated']) + note.save() - return [HttpResponse('', status=303), None] + response = HttpResponse('', status=303) + response['Location'] = note.get_absolute_url() + + return [response, None] def delete(request, course_id, note_id): try: - note = Note.objects.get(note_id) + note = Note.objects.get(id=note_id) except: return [HttpResponse('', status=404), None] diff --git a/lms/static/coffee/src/notes.coffee b/lms/static/coffee/src/notes.coffee index 5153939427..46699b8466 100644 --- a/lms/static/coffee/src/notes.coffee +++ b/lms/static/coffee/src/notes.coffee @@ -40,7 +40,6 @@ class StudentNotes getStoreConfig: (uri) -> prefix = @getPrefix() if uri is null - console.log 'getURIPath()', uri, @getURIPath() uri = @getURIPath() storeConfig =