Skip to content

Commit 6dfa891

Browse files
committed
error fixes
1 parent bd9813c commit 6dfa891

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

source/presentations/session06.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ their tests.
288288

289289
Now, we're ready to add our first actual test..
290290

291-
Test Databse Setup
292-
------------------
291+
Test Database Setup
292+
-------------------
293293

294294
We'd like to test that our database is correctly initialized. The schema has
295295
one table with three columns. Let's test that.

source/presentations/session08.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)