File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -288,8 +288,8 @@ their tests.
288288
289289Now, we're ready to add our first actual test..
290290
291- Test Databse Setup
292- ------------------
291+ Test Database Setup
292+ -------------------
293293
294294We'd like to test that our database is correctly initialized. The schema has
295295one table with three columns. Let's test that.
Original file line number Diff line number Diff line change @@ -501,7 +501,7 @@ It will be a stub for our public UI. Add this to ``views.py`` in ``myblog``
501501.. code-block :: python
502502 :class : small incremental
503503
504- from django.http import HttpResponse
504+ from django.http import HttpResponse, HttpResponseRedirect, Http404
505505
506506 def stub_view (request , * args , ** kwargs ):
507507 body = " Stub View\n\n "
@@ -1670,17 +1670,18 @@ In ``views.py``, update the ``add_view``:
16701670
16711671 def add_view (request ):
16721672 user = request.user
1673- if not user.is_authenticated:
1673+ if not user.is_authenticated() :
16741674 raise PermissionDenied
16751675 if request.method == ' POST' :
16761676 form = PostForm(request.POST )
1677- if form.is_valid:
1677+ if form.is_valid() :
16781678 post = form.save()
16791679 msg = " post '%s ' saved" % post
16801680 messages.add_message(request, messages.INFO , msg)
16811681 return HttpResponseRedirect(reverse(' blog_index' ))
16821682 else :
1683- messages.add_message(" please fix the errors below" )
1683+ messages.add_message(request, messages.INFO ,
1684+ " please fix the errors below" )
16841685 else :
16851686 # ...
16861687
You can’t perform that action at this time.
0 commit comments