Show More
@@ -48,6 +48,9 b' class PostManager(models.Manager):' | |||
|
48 | 48 | Creates new post |
|
49 | 49 | """ |
|
50 | 50 | |
|
51 | if not tags: | |
|
52 | tags = [] | |
|
53 | ||
|
51 | 54 | posting_time = timezone.now() |
|
52 | 55 | if not thread: |
|
53 | 56 | thread = Thread.objects.create(bump_time=posting_time, |
@@ -75,8 +78,8 b' class PostManager(models.Manager):' | |||
|
75 | 78 | post.id)) |
|
76 | 79 | |
|
77 | 80 | thread.replies.add(post) |
|
78 |
|
|
|
79 |
|
|
|
81 | for tag in tags: | |
|
82 | thread.add_tag(tag) | |
|
80 | 83 | |
|
81 | 84 | if new_thread: |
|
82 | 85 | Thread.objects.process_oldest_threads() |
@@ -112,7 +115,8 b' class PostManager(models.Manager):' | |||
|
112 | 115 | """ |
|
113 | 116 | |
|
114 | 117 | posts = self.filter(poster_ip=ip) |
|
115 |
|
|
|
118 | for post in posts: | |
|
119 | self.delete_post(post) | |
|
116 | 120 | |
|
117 | 121 | def connect_replies(self, post): |
|
118 | 122 | """ |
@@ -182,10 +182,6 b' class PagesTest(TestCase):' | |||
|
182 | 182 | |
|
183 | 183 | class FormTest(TestCase): |
|
184 | 184 | def test_post_validation(self): |
|
185 | # Disable captcha for the test | |
|
186 | captcha_enabled = neboard.settings.ENABLE_CAPTCHA | |
|
187 | neboard.settings.ENABLE_CAPTCHA = False | |
|
188 | ||
|
189 | 185 | client = Client() |
|
190 | 186 | |
|
191 | 187 | valid_tags = u'tag1 tag_2 тег_3' |
@@ -222,9 +218,6 b' class FormTest(TestCase):' | |||
|
222 | 218 | self.assertEqual(2, Post.objects.count(), |
|
223 | 219 | msg=u'No posts were created') |
|
224 | 220 | |
|
225 | # Restore captcha setting | |
|
226 | settings.ENABLE_CAPTCHA = captcha_enabled | |
|
227 | ||
|
228 | 221 | |
|
229 | 222 | class ViewTest(TestCase): |
|
230 | 223 |
@@ -86,7 +86,7 b' class AllThreadsView(PostMixin, BaseBoar' | |||
|
86 | 86 | if tag_strings: |
|
87 | 87 | tag_strings = tag_strings.split(TAG_DELIMITER) |
|
88 | 88 | for tag_name in tag_strings: |
|
89 |
tag_name = |
|
|
89 | tag_name = tag_name.strip().lower() | |
|
90 | 90 | if len(tag_name) > 0: |
|
91 | 91 | tag, created = Tag.objects.get_or_create(name=tag_name) |
|
92 | 92 | tags.append(tag) |
@@ -148,8 +148,6 b' INSTALLED_APPS = (' | |||
|
148 | 148 | 'south', |
|
149 | 149 | 'debug_toolbar', |
|
150 | 150 | |
|
151 | 'captcha', | |
|
152 | ||
|
153 | 151 | # Search |
|
154 | 152 | 'haystack', |
|
155 | 153 | |
@@ -168,11 +166,6 b' DEBUG_TOOLBAR_PANELS = (' | |||
|
168 | 166 | 'debug_toolbar.panels.logger.LoggingPanel', |
|
169 | 167 | ) |
|
170 | 168 | |
|
171 | # TODO: NEED DESIGN FIXES | |
|
172 | CAPTCHA_OUTPUT_FORMAT = (u' %(hidden_field)s ' | |
|
173 | u'<div class="form-label">%(image)s</div>' | |
|
174 | u'<div class="form-text">%(text_field)s</div>') | |
|
175 | ||
|
176 | 169 | # A sample logging configuration. The only tangible logging |
|
177 | 170 | # performed by this configuration is to send an email to |
|
178 | 171 | # the site admins on every HTTP 500 error when DEBUG=False. |
@@ -229,9 +222,6 b' THEMES = [' | |||
|
229 | 222 | |
|
230 | 223 | POPULAR_TAGS = 10 |
|
231 | 224 | |
|
232 | ENABLE_CAPTCHA = False | |
|
233 | # if user tries to post before CAPTCHA_DEFAULT_SAFE_TIME. Captcha will be shown | |
|
234 | CAPTCHA_DEFAULT_SAFE_TIME = 30 # seconds | |
|
235 | 225 | POSTING_DELAY = 20 # seconds |
|
236 | 226 | |
|
237 | 227 | COMPRESS_HTML = True |
General Comments 0
You need to be logged in to leave comments.
Login now