Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
modaction: Add filter by admins.
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-d authored and spladug committed Jul 2, 2013
1 parent 0202ad2 commit 23704c8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions r2/r2/controllers/front.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,14 @@ def GET_moderationlog(self, num, after, reverse, count, mod, action):
return self.abort404()

if mod:
try:
mod = Account._by_name(mod, allow_deleted=True)
except NotFound:
mod = None
modnames = g.admins if mod == 'a' else (mod,)
mod = []
for name in modnames:
try:
mod.append(Account._by_name(name, allow_deleted=True))
except NotFound:
continue
mod = mod or None

if isinstance(c.site, (MultiReddit, ModSR)):
srs = Subreddit._byID(c.site.sr_ids, return_dict=False)
Expand Down Expand Up @@ -494,6 +498,7 @@ def GET_moderationlog(self, num, after, reverse, count, mod, action):
for mod_id in mod_ids:
mod = mods[mod_id]
mod_buttons.append(NavButton(mod.name, mod.name, opt='mod'))
mod_buttons.append(NavButton('admins*', 'a', opt='mod'))
base_path = request.path
menus = [NavMenu(action_buttons, base_path=base_path,
title=_('filter by action'), type='lightdrop', css_class='modaction-drop'),
Expand Down

0 comments on commit 23704c8

Please sign in to comment.