Show More
@@ -0,0 +1,19 b'' | |||
|
1 | # -*- coding: utf-8 -*- | |
|
2 | from __future__ import unicode_literals | |
|
3 | ||
|
4 | from django.db import migrations, models | |
|
5 | ||
|
6 | ||
|
7 | class Migration(migrations.Migration): | |
|
8 | ||
|
9 | dependencies = [ | |
|
10 | ('boards', '0034_auto_20151014_2253'), | |
|
11 | ] | |
|
12 | ||
|
13 | operations = [ | |
|
14 | migrations.AlterField( | |
|
15 | model_name='post', | |
|
16 | name='opening', | |
|
17 | field=models.BooleanField(db_index=True), | |
|
18 | ), | |
|
19 | ] |
@@ -98,7 +98,7 b' class Post(models.Model, Viewable):' | |||
|
98 | 98 | uid = models.TextField(db_index=True) |
|
99 | 99 | |
|
100 | 100 | tripcode = models.CharField(max_length=50, blank=True, default='') |
|
101 | opening = models.BooleanField() | |
|
101 | opening = models.BooleanField(db_index=True) | |
|
102 | 102 | hidden = models.BooleanField(default=False) |
|
103 | 103 | |
|
104 | 104 | def __str__(self): |
@@ -194,7 +194,7 b' class Thread(models.Model):' | |||
|
194 | 194 | Gets the first post of the thread |
|
195 | 195 | """ |
|
196 | 196 | |
|
197 |
query = self.get_replies(). |
|
|
197 | query = self.get_replies().filter(opening=True) | |
|
198 | 198 | if only_id: |
|
199 | 199 | query = query.only('id') |
|
200 | 200 | opening_post = query.first() |
@@ -109,7 +109,7 b' TEMPLATE_CONTEXT_PROCESSORS = (' | |||
|
109 | 109 | 'boards.context_processors.user_and_ui_processor', |
|
110 | 110 | ) |
|
111 | 111 | |
|
112 |
MIDDLEWARE_CLASSES = |
|
|
112 | MIDDLEWARE_CLASSES = [ | |
|
113 | 113 | 'django.middleware.http.ConditionalGetMiddleware', |
|
114 | 114 | 'django.contrib.sessions.middleware.SessionMiddleware', |
|
115 | 115 | 'django.middleware.locale.LocaleMiddleware', |
@@ -118,7 +118,7 b' MIDDLEWARE_CLASSES = (' | |||
|
118 | 118 | 'django.contrib.messages.middleware.MessageMiddleware', |
|
119 | 119 | 'boards.middlewares.BanMiddleware', |
|
120 | 120 | 'boards.middlewares.TimezoneMiddleware', |
|
121 | ) | |
|
121 | ] | |
|
122 | 122 | |
|
123 | 123 | ROOT_URLCONF = 'neboard.urls' |
|
124 | 124 | |
@@ -208,6 +208,8 b' IMAGE_VIEWERS = [' | |||
|
208 | 208 | ('popup', 'Popup'), |
|
209 | 209 | ] |
|
210 | 210 | |
|
211 | ALLOWED_HOSTS = ['*'] | |
|
212 | ||
|
211 | 213 | POSTING_DELAY = 20 # seconds |
|
212 | 214 | |
|
213 | 215 | # Websocket settins |
@@ -219,21 +221,20 b" CENTRIFUGE_PROJECT_ID = '<project id her" | |||
|
219 | 221 | CENTRIFUGE_PROJECT_SECRET = '<project secret here>' |
|
220 | 222 | CENTRIFUGE_TIMEOUT = 5 |
|
221 | 223 | |
|
222 |
# Debug m |
|
|
223 | if DEBUG: | |
|
224 | MIDDLEWARE_CLASSES += ( | |
|
225 | 'debug_toolbar.middleware.DebugToolbarMiddleware', | |
|
226 | ) | |
|
224 | # Debug middlewares | |
|
225 | MIDDLEWARE_CLASSES += [ | |
|
226 | 'debug_toolbar.middleware.DebugToolbarMiddleware', | |
|
227 | ] | |
|
227 | 228 | |
|
228 |
|
|
|
229 | return True | |
|
229 | def custom_show_toolbar(request): | |
|
230 | return request.user.has_perm('admin.debug') | |
|
230 | 231 | |
|
231 |
|
|
|
232 |
|
|
|
233 |
|
|
|
234 | } | |
|
232 | DEBUG_TOOLBAR_CONFIG = { | |
|
233 | 'ENABLE_STACKTRACES': True, | |
|
234 | 'SHOW_TOOLBAR_CALLBACK': 'neboard.settings.custom_show_toolbar', | |
|
235 | } | |
|
235 | 236 | |
|
236 |
|
|
|
237 |
|
|
|
238 |
|
|
|
239 | #) | |
|
237 | # FIXME Uncommenting this fails somehow. Need to investigate this | |
|
238 | #DEBUG_TOOLBAR_PANELS += ( | |
|
239 | # 'debug_toolbar.panels.profiling.ProfilingDebugPanel', | |
|
240 | #) |
General Comments 0
You need to be logged in to leave comments.
Login now