Explorar o código

Improved the timezone middleware example slightly.

This change avoids having the timezone leak from a request to the next.
Aymeric Augustin %!s(int64=12) %!d(string=hai) anos
pai
achega
c8dcee9a42
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      docs/topics/i18n/timezones.txt

+ 2 - 0
docs/topics/i18n/timezones.txt

@@ -189,6 +189,8 @@ Add the following middleware to :setting:`MIDDLEWARE_CLASSES`::
             tz = request.session.get('django_timezone')
             if tz:
                 timezone.activate(tz)
+            else:
+                timezone.deactivate()
 
 Create a view that can set the current timezone::