# HG changeset patch # User Paul Boddie # Date 1528802615 -7200 # Node ID 4d45a97b93824b0dfd56d0eee6bf569835715362 # Parent 8300a45fc074e811da92f58d92f67050932cb7c9 Fixed embarrassing bug that caused existing first comments to be overwritten. diff -r 8300a45fc074 -r 4d45a97b9382 actions/PostComment.py --- a/actions/PostComment.py Tue Jun 12 13:22:51 2018 +0200 +++ b/actions/PostComment.py Tue Jun 12 13:23:35 2018 +0200 @@ -2,7 +2,7 @@ """ MoinMoin - PostComment action - @copyright: 2013 by Paul Boddie + @copyright: 2013, 2018 by Paul Boddie @license: GNU GPL (v2 or later), see COPYING.txt for details. """ @@ -80,7 +80,10 @@ # Determine the last comment. comments = get_comment_numbers(self.pagename, request) - last_comment_pagename = comments and comments[-1] or -1 + if comments: + last_comment_pagename = comments[-1] + else: + last_comment_pagename = -1 # Write the new page.