##// END OF EJS Templates
Don't allow parsing a post when its thread is not parsed yet
neko259 -
r1838:c7821a56 default
parent child Browse files
Show More
@@ -16,6 +16,7 b" EXCEPTION_DOWNLOAD = 'File was not downl"
16 EXCEPTION_HASH = 'File hash does not match attachment hash.'
16 EXCEPTION_HASH = 'File hash does not match attachment hash.'
17 EXCEPTION_SIGNATURE = 'Invalid model signature for {}.'
17 EXCEPTION_SIGNATURE = 'Invalid model signature for {}.'
18 EXCEPTION_AUTHOR_SIGNATURE = 'Model {} has no author signature.'
18 EXCEPTION_AUTHOR_SIGNATURE = 'Model {} has no author signature.'
19 EXCEPTION_THREAD = 'No thread exists for post {}'
19 ENCODING_UNICODE = 'unicode'
20 ENCODING_UNICODE = 'unicode'
20
21
21 TAG_MODEL = 'model'
22 TAG_MODEL = 'model'
@@ -217,7 +218,7 b' class SyncManager:'
217 if exists:
218 if exists:
218 opening_post = Post.objects.get(global_id=op_global_id)
219 opening_post = Post.objects.get(global_id=op_global_id)
219 else:
220 else:
220 logger.debug('No thread exists for post {}'.format(global_id))
221 raise Exception(EXCEPTION_THREAD.format(global_id))
221 else:
222 else:
222 opening_post = None
223 opening_post = None
223 tag_tags = tag_content.find(TAG_TAGS)
224 tag_tags = tag_content.find(TAG_TAGS)
@@ -375,4 +376,4 b' class SyncManager:'
375 if opening_post:
376 if opening_post:
376 ThreadFilter().add_filter(model, opening_post)
377 ThreadFilter().add_filter(model, opening_post)
377
378
378 return et.tostring(request, 'unicode') No newline at end of file
379 return et.tostring(request, 'unicode')
General Comments 0
You need to be logged in to leave comments. Login now