##// END OF EJS Templates
Optimized one query, removed debug code from settings so that it is run only...
neko259 -
r472:df52a056 default
parent child Browse files
Show More
@@ -183,12 +183,12 b' def thread(request, post_id, mode=MODE_N'
183 postFormClass = PostForm
183 postFormClass = PostForm
184 kwargs = {}
184 kwargs = {}
185
185
186 opening_post = get_object_or_404(Post, id=post_id)
186 if request.method == 'POST':
187 if request.method == 'POST':
187 form = postFormClass(request.POST, request.FILES,
188 form = postFormClass(request.POST, request.FILES,
188 error_class=PlainErrorList, **kwargs)
189 error_class=PlainErrorList, **kwargs)
189 form.session = request.session
190 form.session = request.session
190
191
191 opening_post = get_object_or_404(Post, id=post_id)
192 if form.is_valid():
192 if form.is_valid():
193 return _new_post(request, form, opening_post)
193 return _new_post(request, form, opening_post)
194 if form.need_to_ban:
194 if form.need_to_ban:
@@ -197,7 +197,7 b' def thread(request, post_id, mode=MODE_N'
197 else:
197 else:
198 form = postFormClass(error_class=PlainErrorList, **kwargs)
198 form = postFormClass(error_class=PlainErrorList, **kwargs)
199
199
200 thread_to_show = get_object_or_404(Post, id=post_id).thread_new
200 thread_to_show = opening_post.thread_new
201
201
202 context = _init_default_context(request)
202 context = _init_default_context(request)
203
203
@@ -223,19 +223,25 b' POSTING_DELAY = 20 # seconds'
223
223
224 COMPRESS_HTML = True
224 COMPRESS_HTML = True
225
225
226 def custom_show_toolbar(request):
227 return DEBUG
228
229 DEBUG_TOOLBAR_CONFIG = {
230 'INTERCEPT_REDIRECTS': False,
231 'SHOW_TOOLBAR_CALLBACK': custom_show_toolbar,
232 'HIDE_DJANGO_SQL': False,
233 'ENABLE_STACKTRACES': True,
234 }
235
236 # Debug mode middlewares
226 # Debug mode middlewares
237 if DEBUG:
227 if DEBUG:
238 MIDDLEWARE_CLASSES += (
228 MIDDLEWARE_CLASSES += (
239 'boards.profiler.ProfilerMiddleware',
229 'boards.profiler.ProfilerMiddleware',
240 'debug_toolbar.middleware.DebugToolbarMiddleware',
230 'debug_toolbar.middleware.DebugToolbarMiddleware',
241 )
231 )
232
233 def custom_show_toolbar(request):
234 return DEBUG
235
236 DEBUG_TOOLBAR_CONFIG = {
237 'INTERCEPT_REDIRECTS': False,
238 'SHOW_TOOLBAR_CALLBACK': custom_show_toolbar,
239 'HIDE_DJANGO_SQL': False,
240 'ENABLE_STACKTRACES': True,
241 }
242
243 # FIXME Uncommenting this fails somehow. Need to investigate this
244 #DEBUG_TOOLBAR_PANELS += (
245 # 'debug_toolbar.panels.profiling.ProfilingDebugPanel',
246 #)
247
General Comments 0
You need to be logged in to leave comments. Login now