Show More
@@ -291,10 +291,14 b' class Thread(models.Model):' | |||
|
291 | 291 | for depth, element in tree: |
|
292 | 292 | index += 1 |
|
293 | 293 | if element in parents: |
|
294 | found_parent = True | |
|
295 | ||
|
294 | 296 | offset_under_parent = parent_positions.get(element, 1) |
|
295 | 297 | tree.insert(index + offset_under_parent - 1, (depth + 1, reply)) |
|
296 | parent_positions[element] = offset_under_parent + 1 | |
|
297 |
|
|
|
298 | ||
|
299 | # Move whole parent tree by 1 added element | |
|
300 | for parent in parents: | |
|
301 | parent_positions[parent] = parent_positions.get(parent, 1) + 1 | |
|
298 | 302 | |
|
299 | 303 | if not found_parent: |
|
300 | 304 | tree.append((0, reply)) |
General Comments 0
You need to be logged in to leave comments.
Login now