mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-02-02 18:55:32 -05:00
wiki: Do not bother listing deleted editors.
This commit is contained in:
@@ -287,14 +287,13 @@ class WikiApiController(WikiController):
|
||||
VWikiModerator(),
|
||||
page=VWikiPage('page'),
|
||||
act=VOneOf('act', ('del', 'add')),
|
||||
user=VExistingUname('username'),
|
||||
username=nop('username'))
|
||||
user=VExistingUname('username'))
|
||||
@api_doc(api_section.wiki, uri='/api/wiki/alloweditor/:act')
|
||||
def POST_wiki_allow_editor(self, act, page, user, username):
|
||||
if act == 'del':
|
||||
page.remove_editor(username)
|
||||
elif not user:
|
||||
def POST_wiki_allow_editor(self, act, page, user):
|
||||
if not user:
|
||||
self.handle_error(404, 'UNKNOWN_USER')
|
||||
elif act == 'del':
|
||||
page.remove_editor(user.name)
|
||||
elif act == 'add':
|
||||
page.add_editor(user.name)
|
||||
else:
|
||||
|
||||
@@ -263,9 +263,10 @@ class WikiPage(tdb_cassandra.Thing):
|
||||
|
||||
def get_editor_accounts(self):
|
||||
editors = self.get_editors()
|
||||
accounts = []
|
||||
for editor in editors:
|
||||
accounts.append(Account._by_name(editor, allow_deleted=True))
|
||||
accounts = [Account._by_name(editor, allow_deleted=True)
|
||||
for editor in self.get_editors()]
|
||||
accounts = [account for account in accounts
|
||||
if not account._deleted]
|
||||
return accounts
|
||||
|
||||
def get_editors(self, properties=None):
|
||||
|
||||
Reference in New Issue
Block a user