##// END OF EJS Templates
Parse tripcode for post sync
neko259 -
r1557:68d42ef1 default
parent child Browse files
Show More
@@ -129,7 +129,8 b' class PostManager(models.Manager):'
129 129
130 130 @transaction.atomic
131 131 def import_post(self, title: str, text: str, pub_time: str, global_id,
132 opening_post=None, tags=list(), files=list()):
132 opening_post=None, tags=list(), files=list(),
133 tripcode=None):
133 134 is_opening = opening_post is None
134 135 if is_opening:
135 136 thread = boards.models.thread.Thread.objects.create(
@@ -144,7 +145,7 b' class PostManager(models.Manager):'
144 145 last_edit_time=pub_time,
145 146 global_id=global_id,
146 147 opening=is_opening,
147 thread=thread)
148 thread=thread, tripcode=tripcode)
148 149
149 150 # TODO Add files
150 151 for file in files:
@@ -177,6 +177,7 b' class SyncManager:'
177 177 title = tag_content.find(TAG_TITLE).text or ''
178 178 text = tag_content.find(TAG_TEXT).text or ''
179 179 pub_time = tag_content.find(TAG_PUB_TIME).text
180 tripcode = tag_content.find(TAG_TRIPCODE).text
180 181
181 182 thread = tag_content.find(TAG_THREAD)
182 183 tags = []
@@ -218,7 +219,7 b' class SyncManager:'
218 219 Post.objects.import_post(
219 220 title=title, text=text, pub_time=pub_time,
220 221 opening_post=opening_post, tags=tags,
221 global_id=global_id, files=files)
222 global_id=global_id, files=files, tripcode=tripcode)
222 223 else:
223 224 raise SyncException(EXCEPTION_NODE.format(tag_status.text))
224 225
General Comments 0
You need to be logged in to leave comments. Login now