diff options
Diffstat (limited to 'libbe/comment.py')
-rw-r--r-- | libbe/comment.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libbe/comment.py b/libbe/comment.py index 1582632..3b8a9c7 100644 --- a/libbe/comment.py +++ b/libbe/comment.py @@ -155,6 +155,8 @@ class Comment(Tree, settings_object.SavedSettingsObject): decode=self.content_type.startswith("text/")) def _set_comment_body(self, old=None, new=None, force=False): assert self.uuid != INVALID_UUID, self + if self.bug != None and self.bug.bugdir != None: + new = libbe.util.id.short_to_long_user([self.bug.bugdir], new) if (self.storage != None and self.storage.writeable == True) \ or force==True: assert new != None, "Can't save empty comment" @@ -460,7 +462,10 @@ class Comment(Tree, settings_object.SavedSettingsObject): lines.append("Date: %s" % self.date) lines.append("") if self.content_type.startswith("text/"): - lines.extend((self.body or "").splitlines()) + body = (self.body or "") + if self.bug != None and self.bug.bugdir != None: + body = libbe.util.id.long_to_short_user([self.bug.bugdir], body) + lines.extend(body.splitlines()) else: lines.append("Content type %s not printable. Try XML output instead" % self.content_type) |