Changeset 1481
- Timestamp:
- 03/10/08 17:28:55 (2 years ago)
- Files:
-
- 1 modified
-
trunk/pylucid/PyLucid/middlewares/pagestats.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid/PyLucid/middlewares/pagestats.py
r1427 r1481 23 23 from operator import add 24 24 from time import time 25 25 26 from django.db import connection 26 27 from django.core.exceptions import ImproperlyConfigured 28 27 29 from PyLucid.template_addons.filters import human_duration 28 30 … … 70 72 71 73 # compute the db time for the queries just run 74 # FIXME: In my shared webhosting environment the queries is always = 0 72 75 queries = len(connection.queries) - old_queries 73 76 … … 84 87 try: 85 88 response.content = response.content.replace(TAG, stat_info) 86 except: 87 # Unicode errors?!?! 88 pass 89 except UnicodeError: 90 # FIXME: In my shared webhosting environment is response.content a 91 # string and not unicode. Why? 92 from django.utils.encoding import force_unicode 93 try: 94 response.content = force_unicode(response.content)\ 95 .replace(TAG, stat_info) 96 except: 97 pass 89 98 90 99 return response