diff --git a/webapp_moderation.py b/webapp_moderation.py index 2ba253ff9..45401d380 100644 --- a/webapp_moderation.py +++ b/webapp_moderation.py @@ -163,35 +163,41 @@ def htmlModerationInfo(cssCache: {}, translate: {}, infoForm += ' \n' infoForm += ' \n' infoForm += '\n' - col = 0 + accounts = [] for subdir, dirs, files in os.walk(baseDir + '/accounts'): for acct in dirs: if '@' not in acct: continue if 'inbox@' in acct or 'news@' in acct: continue - accountDir = os.path.join(baseDir + '/accounts', acct) - acctNickname = acct.split('@')[0] - actorJson = loadJson(accountDir + '.json') - if not actorJson: - continue - actor = actorJson['id'] - avatarUrl = '' - if actorJson.get('icon'): - if actorJson['icon'].get('url'): - avatarUrl = actorJson['icon']['url'] - acctUrl = \ - '/users/' + nickname + '?options=' + actor + ';1;' + \ - '/avatars/' + avatarUrl.replace('/', '-') - infoForm += '\n' - infoForm += '' - infoForm += '
' + acctNickname - infoForm += '
\n\n' - col += 1 - if col == cols: - # new row of accounts - infoForm += '\n\n' + accounts.append(acct) break + accounts.sort() + + col = 0 + for acct in accounts: + acctNickname = acct.split('@')[0] + accountDir = os.path.join(baseDir + '/accounts', acct) + actorJson = loadJson(accountDir + '.json') + if not actorJson: + continue + actor = actorJson['id'] + avatarUrl = '' + if actorJson.get('icon'): + if actorJson['icon'].get('url'): + avatarUrl = actorJson['icon']['url'] + acctUrl = \ + '/users/' + nickname + '?options=' + actor + ';1;' + \ + '/avatars/' + avatarUrl.replace('/', '-') + infoForm += '\n' + infoForm += '' + infoForm += '
' + acctNickname + infoForm += '
\n\n' + col += 1 + if col == cols: + # new row of accounts + infoForm += '\n\n' infoForm += '\n\n' infoForm += '\n'