Show More
@@ -183,12 +183,12 b' def thread(request, post_id, mode=MODE_N' | |||
|
183 | 183 | postFormClass = PostForm |
|
184 | 184 | kwargs = {} |
|
185 | 185 | |
|
186 | opening_post = get_object_or_404(Post, id=post_id) | |
|
186 | 187 | if request.method == 'POST': |
|
187 | 188 | form = postFormClass(request.POST, request.FILES, |
|
188 | 189 | error_class=PlainErrorList, **kwargs) |
|
189 | 190 | form.session = request.session |
|
190 | 191 | |
|
191 | opening_post = get_object_or_404(Post, id=post_id) | |
|
192 | 192 | if form.is_valid(): |
|
193 | 193 | return _new_post(request, form, opening_post) |
|
194 | 194 | if form.need_to_ban: |
@@ -197,7 +197,7 b' def thread(request, post_id, mode=MODE_N' | |||
|
197 | 197 | else: |
|
198 | 198 | form = postFormClass(error_class=PlainErrorList, **kwargs) |
|
199 | 199 | |
|
200 |
thread_to_show = |
|
|
200 | thread_to_show = opening_post.thread_new | |
|
201 | 201 | |
|
202 | 202 | context = _init_default_context(request) |
|
203 | 203 |
@@ -223,19 +223,25 b' POSTING_DELAY = 20 # seconds' | |||
|
223 | 223 | |
|
224 | 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 | 226 | # Debug mode middlewares |
|
237 | 227 | if DEBUG: |
|
238 | 228 | MIDDLEWARE_CLASSES += ( |
|
239 | 229 | 'boards.profiler.ProfilerMiddleware', |
|
240 | 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