mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-04-13 09:42:01 +00:00
I believe this Context wrapping is still preserved. See this django ticket: https://code.djangoproject.com/ticket/28125. Reverting this fixes the error, so I'm assuming this is that type of render.
This commit is contained in:
parent
36b0823786
commit
553483ce52
1 changed files with 3 additions and 3 deletions
|
@ -7,7 +7,7 @@ from utils import log as logging
|
|||
from django.http import HttpResponse
|
||||
from django.conf import settings
|
||||
from django.db import connection
|
||||
from django.template import Template
|
||||
from django.template import Template, Context
|
||||
from apps.statistics.rstats import round_time
|
||||
from utils import json_functions as json
|
||||
|
||||
|
@ -121,11 +121,11 @@ class SQLLogToConsoleMiddleware:
|
|||
query['sql'] = re.sub(r'DELETE', '~FR~SBDELETE', query['sql'])
|
||||
t = Template("{% for sql in sqllog %}{% if not forloop.first %} {% endif %}[{{forloop.counter}}] ~FC{{sql.time}}s~FW: {{sql.sql|safe}}{% if not forloop.last %}\n{% endif %}{% endfor %}")
|
||||
if settings.DEBUG:
|
||||
logging.debug(t.render({
|
||||
logging.debug(t.render(Context({
|
||||
'sqllog': queries,
|
||||
'count': len(queries),
|
||||
'time': time_elapsed,
|
||||
}))
|
||||
})))
|
||||
times_elapsed = {
|
||||
'sql': sum([float(q['time'])
|
||||
for q in queries if not q.get('mongo') and
|
||||
|
|
Loading…
Add table
Reference in a new issue