mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-25 06:48:01 -05:00
Don't link subreddit creator if they're not a moderator.
This commit is contained in:
@@ -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':
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
<div class="bottom">
|
||||
%if thing.sr.author:
|
||||
${unsafe(_("created by %(user)s") % dict(user = unsafe(WrappedUser(thing.sr.author).render())))}
|
||||
${unsafe(_("created by %(user)s") % dict(user = unsafe(thing.creator_text)))}
|
||||
%endif
|
||||
|
||||
<span class="age">
|
||||
|
||||
Reference in New Issue
Block a user