Don't link subreddit creator if they're not a moderator.

This commit is contained in:
Brian Simpson
2013-11-13 19:18:14 -05:00
parent bad6963ae0
commit f79949ae60
2 changed files with 10 additions and 1 deletions

View File

@@ -804,6 +804,15 @@ class SubredditInfoBar(CachedTemplate):
CachedTemplate.__init__(self)
@property
def creator_text(self):
if self.sr.author:
if self.sr.is_moderator(self.sr.author) or self.sr.author._deleted:
return WrappedUser(self.sr.author).render()
else:
return self.sr.author.name
return None
def nav(self):
buttons = [NavButton(plurals.moderators, 'moderators')]
if self.type != 'public':

View File

@@ -71,7 +71,7 @@
<div class="bottom">
%if thing.sr.author:
${unsafe(_("created by&#32;%(user)s") % dict(user = unsafe(WrappedUser(thing.sr.author).render())))}
${unsafe(_("created by&#32;%(user)s") % dict(user = unsafe(thing.creator_text)))}
%endif
<span class="age">