X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/0a2b0284b8fcb5a613f1cc3da59fc637d3033363..b00a18907b95d74b040d7950bd18d2b2a7709cb1:/forum/models/user.py diff --git a/forum/models/user.py b/forum/models/user.py index d3b2c6f..699c7bc 100644 --- a/forum/models/user.py +++ b/forum/models/user.py @@ -282,9 +282,9 @@ class User(BaseModel, DjangoUser): def can_delete_comment(self, comment): return self == comment.author or self.reputation >= int(settings.REP_TO_DELETE_COMMENTS) - @true_if_is_super_or_staff def can_convert_comment_to_answer(self, comment): - return self == comment.author or self.reputation >= int(settings.REP_TO_CONVERT_COMMENTS_TO_ANSWERS) + return (comment.parent.node_type in ('question', 'answer')) and (self.is_superuser or self.is_staff or ( + self == comment.author) or (self.reputation >= int(settings.REP_TO_CONVERT_COMMENTS_TO_ANSWERS))) def can_convert_to_comment(self, answer): return (not answer.marked) and (self.is_superuser or self.is_staff or answer.author == self or self.reputation >= int