Skip to content

Commit

Permalink
Fix import_json view
Browse files Browse the repository at this point in the history
This view is returning a 500 on production because a bad
`render_to_response` call:
    https://sentry.io/columbia-ctl/uelc/issues/279731846/

I've replaced `render_to_response` with `render` in a previous commit,
but the call was still bad - I needed to remove the context_instance
argument, it's not necessary since the plain request is passed in to
render().
  • Loading branch information
nikolas committed May 24, 2017
1 parent 66b3671 commit deee57a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.3.2
==================

* Fixed an issue with the json import view

1.3.1 (2017-03-22)
==================

Expand Down
4 changes: 1 addition & 3 deletions pagetree/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from django.http import HttpResponse, HttpResponseRedirect
from django.utils.encoding import smart_text
from django.shortcuts import get_object_or_404, render
from django.template.context import RequestContext
from django.template.defaultfilters import slugify
from django.template.response import TemplateResponse
from json import dumps, loads
Expand Down Expand Up @@ -80,8 +79,7 @@ def import_pageblock_json(request, pageblock_id):
block.import_from_dict(json)
return HttpResponseRedirect(block.section.get_edit_url())
else:
return render(request, "import_json.html", dict(),
context_instance=RequestContext(request))
return render(request, "import_json.html")


def edit_pageblock(request, pageblock_id, success_url=None):
Expand Down

0 comments on commit deee57a

Please sign in to comment.