##// 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,6 +223,13 b' POSTING_DELAY = 20 # seconds'
223
223
224 COMPRESS_HTML = True
224 COMPRESS_HTML = True
225
225
226 # Debug mode middlewares
227 if DEBUG:
228 MIDDLEWARE_CLASSES += (
229 'boards.profiler.ProfilerMiddleware',
230 'debug_toolbar.middleware.DebugToolbarMiddleware',
231 )
232
226 def custom_show_toolbar(request):
233 def custom_show_toolbar(request):
227 return DEBUG
234 return DEBUG
228
235
@@ -233,9 +240,8 b' DEBUG_TOOLBAR_CONFIG = {'
233 'ENABLE_STACKTRACES': True,
240 'ENABLE_STACKTRACES': True,
234 }
241 }
235
242
236 # Debug mode middlewares
243 # FIXME Uncommenting this fails somehow. Need to investigate this
237 if DEBUG:
244 #DEBUG_TOOLBAR_PANELS += (
238 MIDDLEWARE_CLASSES += (
245 # 'debug_toolbar.panels.profiling.ProfilingDebugPanel',
239 'boards.profiler.ProfilerMiddleware',
246 #)
240 'debug_toolbar.middleware.DebugToolbarMiddleware',
247
241 )
General Comments 0
You need to be logged in to leave comments. Login now