wiki: Do not bother listing deleted editors.

This commit is contained in:
Andre D
2012-10-18 14:01:28 -05:00
committed by Neil Williams
parent 4f4729fc74
commit e382c64a71
2 changed files with 9 additions and 9 deletions

View File

@@ -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:

View File

@@ -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):