From ce7776f59dd704e327762becf53ff9d650c61af2 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Thu, 7 Mar 2013 22:12:39 -0800 Subject: [PATCH] Add author_slow to Comment as queries.ban needs it. --- r2/r2/models/link.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/r2/r2/models/link.py b/r2/r2/models/link.py index b29355bf9..199d351a6 100755 --- a/r2/r2/models/link.py +++ b/r2/r2/models/link.py @@ -793,6 +793,13 @@ class Comment(Thing, Printable): sr_id = l.sr_id return Subreddit._byID(sr_id, True, return_dict=False) + @property + def author_slow(self): + """Returns the comment's author.""" + # The author is often already on the wrapped comment as .author + # If available, that should be used instead of calling this + return Account._byID(self.author_id, data=True, return_dict=False) + def keep_item(self, wrapped): return True