1.1 --- a/actions/PostComment.py Tue Jun 12 13:22:51 2018 +0200
1.2 +++ b/actions/PostComment.py Tue Jun 12 13:23:35 2018 +0200
1.3 @@ -2,7 +2,7 @@
1.4 """
1.5 MoinMoin - PostComment action
1.6
1.7 - @copyright: 2013 by Paul Boddie <paul@boddie.org.uk>
1.8 + @copyright: 2013, 2018 by Paul Boddie <paul@boddie.org.uk>
1.9 @license: GNU GPL (v2 or later), see COPYING.txt for details.
1.10 """
1.11
1.12 @@ -80,7 +80,10 @@
1.13 # Determine the last comment.
1.14
1.15 comments = get_comment_numbers(self.pagename, request)
1.16 - last_comment_pagename = comments and comments[-1] or -1
1.17 + if comments:
1.18 + last_comment_pagename = comments[-1]
1.19 + else:
1.20 + last_comment_pagename = -1
1.21
1.22 # Write the new page.
1.23