zerver/lib: remove import six.

This commit is contained in:
rht
2017-09-27 10:06:17 +02:00
committed by Tim Abbott
parent 43fd0e8134
commit 035ed93111
17 changed files with 21 additions and 39 deletions

View File

@@ -3,7 +3,6 @@ from django.db.models import Q
from zerver.models import UserProfile, Realm
from zerver.lib.cache import cache_with_key, realm_alert_words_cache_key
import ujson
import six
from typing import Dict, Iterable, List, Text
@cache_with_key(realm_alert_words_cache_key, timeout=3600*24)
@@ -12,7 +11,7 @@ def alert_words_in_realm(realm):
users_query = UserProfile.objects.filter(realm=realm, is_active=True)
alert_word_data = users_query.filter(~Q(alert_words=ujson.dumps([]))).values('id', 'alert_words')
all_user_words = dict((elt['id'], ujson.loads(elt['alert_words'])) for elt in alert_word_data)
user_ids_with_words = dict((user_id, w) for (user_id, w) in six.iteritems(all_user_words) if len(w))
user_ids_with_words = dict((user_id, w) for (user_id, w) in all_user_words.items() if len(w))
return user_ids_with_words
def user_alert_words(user_profile):