tangowithcode / tango_with_django_19

A beginners guide to web programming with Python / Django 1.9
Apache License 2.0
207 stars 188 forks source link

Typo in Chapter 11 Section 5 #25

Closed McMutton closed 8 years ago

McMutton commented 8 years ago

In this section, we have the lines below for the index view:

    # Get the number of visits to the site.
    # We use the COOKIES.get() function to obtain the visits cookie.
    # If the cookie exists, the value returned is casted to an integer.
    # If the cookie doesn't exist, we default to zero and cast that.
    visits = int(request.COOKIES.get('visits', '1'))

The comment says that we default the value to zero actually it is defaulted to one

leifos commented 8 years ago

Thanks!

On 13 Jun 2016, at 16:35, Burak Karaboğa notifications@github.com wrote:

In this section, we have the lines below for the index view:

# Get the number of visits to the site.
# We use the COOKIES.get() function to obtain the visits cookie.
# If the cookie exists, the value returned is casted to an integer.
# If the cookie doesn't exist, we default to zero and cast that.
visits = int(request.COOKIES.get('visits', '1'))

The comment says that we default the value to zero actually it is defaulted to one

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/leifos/tango_with_django_19/issues/25, or mute the thread https://github.com/notifications/unsubscribe/AB02B-JrNbtlA6HweCY3jSWyLCRKMV-Iks5qLXiogaJpZM4I0dCR.

maxwelld90 commented 8 years ago

Magic!