Commit 8ea1b91a authored by Jérome Perrin's avatar Jérome Perrin

commerce: py3

parent 3e82e43f
...@@ -16,13 +16,13 @@ for web_section in web_site.WebSite_getMainSectionList(): ...@@ -16,13 +16,13 @@ for web_section in web_site.WebSite_getMainSectionList():
if len(product_dict) > limit: if len(product_dict) > limit:
random_uid_list = [] random_uid_list = []
key_list = product_dict.keys() key_list = list(product_dict.keys())
while len(random_uid_list) < limit: while len(random_uid_list) < limit:
random_uid = choice(key_list) random_uid = choice(key_list)
key_list.remove(random_uid) key_list.remove(random_uid)
random_uid_list.append(random_uid) random_uid_list.append(random_uid)
product_list = [product_dict.get(uid) for uid in random_uid_list] product_list = [product_dict.get(uid) for uid in random_uid_list]
else: else:
product_list = product_dict.values() product_list = list(product_dict.values())
return product_list return product_list
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment