aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask/collect.py
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/wqflask/collect.py')
-rw-r--r--wqflask/wqflask/collect.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py
index 42a09fed..9752c8b5 100644
--- a/wqflask/wqflask/collect.py
+++ b/wqflask/wqflask/collect.py
@@ -1,6 +1,3 @@
-from __future__ import print_function, division, absolute_import
-
-
import os
import hashlib
import datetime
@@ -10,7 +7,7 @@ import uuid
import hashlib
import base64
-import urlparse
+import urllib.parse
import simplejson as json
@@ -38,7 +35,9 @@ from utility.logger import getLogger
logger = getLogger(__name__)
def process_traits(unprocessed_traits):
- if isinstance(unprocessed_traits, basestring):
+ if isinstance(unprocessed_traits, bytes):
+ unprocessed_traits = unprocessed_traits.decode('utf-8').split(",")
+ else: # It's a string
unprocessed_traits = unprocessed_traits.split(",")
traits = set()
for trait in unprocessed_traits:
@@ -125,7 +124,8 @@ def collections_new():
g.user_session.add_traits_to_collection(collection_id, traits)
return redirect(url_for('view_collection', uc_id=collection_id))
else:
- CauseAnError
+ # CauseAnError
+ pass
def create_new(collection_name):
params = request.args
@@ -193,7 +193,7 @@ def view_collection():
params = request.args
uc_id = params['uc_id']
- uc = (collection for collection in g.user_session.user_collections if collection["id"] == uc_id).next()
+ uc = next((collection for collection in g.user_session.user_collections if collection["id"] == uc_id))
traits = uc["members"]
trait_obs = []