Show More
@@ -9,6 +9,7 b' from django.db import models, transactio' | |||
|
9 | 9 | from django.utils.dateparse import parse_datetime |
|
10 | 10 | from django.utils.timezone import utc |
|
11 | 11 | from django.utils import timezone |
|
12 | from django.utils.html import strip_tags | |
|
12 | 13 | |
|
13 | 14 | from boards.models import Post |
|
14 | 15 | from boards.models.post import TITLE_MAX_LENGTH |
@@ -64,7 +65,7 b' class ThreadSource(models.Model):' | |||
|
64 | 65 | if timestamp > last_timestamp: |
|
65 | 66 | last_timestamp = timestamp |
|
66 | 67 | if timestamp > start_timestamp: |
|
67 | Post.objects.create_post(title=title, text=item.description, | |
|
68 | Post.objects.create_post(title=title, text=self.parse_text(item.description), | |
|
68 | 69 | thread=self.thread, file_urls=[item.link], tripcode=tripcode) |
|
69 | 70 | logger.info('Fetched item {} from {} into thread {}'.format( |
|
70 | 71 | title, self.name, self.thread)) |
@@ -72,3 +73,5 b' class ThreadSource(models.Model):' | |||
|
72 | 73 | self.timestamp = last_timestamp |
|
73 | 74 | self.save(update_fields=['timestamp']) |
|
74 | 75 | |
|
76 | def parse_text(self, text): | |
|
77 | return strip_tags(text) |
General Comments 0
You need to be logged in to leave comments.
Login now