File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
call_server/political_data/countries Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -456,11 +456,12 @@ def load_data(self):
456456 # if cache is redis, add lexigraphical index on states, names
457457 if hasattr (self ._cache , 'cache' ) and isinstance (self ._cache .cache , flask_caching .backends .rediscache .RedisCache ):
458458 redis = self ._cache .cache ._write_client
459- searchable_items = legislators .items () + governors .items ()
460- for (key ,record ) in searchable_items :
461- for sorted_key in self .SORTED_SETS :
462- if key .startswith (sorted_key ):
463- redis .zadd (sorted_key , key , 0 )
459+ searchable_items = [legislators .items (), governors .items ()]
460+ for item in searchable_items :
461+ for (key , value ) in item :
462+ for sorted_key in self .SORTED_SETS :
463+ if key .startswith (sorted_key ):
464+ redis .zadd (sorted_key , {key : 0 })
464465
465466 success = [
466467 "%s zipcodes" % len (districts ),
You can’t perform that action at this time.
0 commit comments