From c8dcee9a423fa3f31a2303e7ec20a924775730a2 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Wed, 15 May 2013 16:43:39 +0200 Subject: [PATCH] Improved the timezone middleware example slightly. This change avoids having the timezone leak from a request to the next. --- docs/topics/i18n/timezones.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/topics/i18n/timezones.txt b/docs/topics/i18n/timezones.txt index 22a0edb073..e4a043b08f 100644 --- a/docs/topics/i18n/timezones.txt +++ b/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::