Permalink
Browse files

Fixes crash when editing imported text with orphan comment.

  • Loading branch information...
gibus
gibus committed Jan 31, 2013
1 parent 876a14e commit 72909d89f99ccc1ba6293e268b078469c35ceafa
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/cm/views/create.py
View
@@ -195,7 +195,9 @@ def _text_create_import(request, createForm):
# Process comments.
if soup.co_ment_text.comments:
comments_ids_map = {}
for imported_comment in soup.co_ment_text.comments.findAll('comment'):
all_comments = soup.co_ment_text.comments.findAll('comment')
# Sort by id in order to have parent processed before reply_to
for imported_comment in sorted(all_comments, key=lambda cid: cid.id.renderContents()):
# Creates each comment.
comment = Comment.objects.create(
text_version=text.get_latest_version(),

0 comments on commit 72909d8

Please sign in to comment.