aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2023-06-08 16:52:43 +0000
committerzsloan2023-06-08 16:54:14 +0000
commit0dd3d818c36b12010c27775e0a79349718364ba6 (patch)
tree792d1bb559e44608f1b009610adee75995b32c71
parent0cd4b09cc56c5dda7bda4ed989ab0ba72c43ac31 (diff)
downloadgenenetwork2-0dd3d818c36b12010c27775e0a79349718364ba6.tar.gz
Fix bug by providing anon_id to collections/add
-rw-r--r--wqflask/wqflask/collect.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py
index eaed239d..87f7948d 100644
--- a/wqflask/wqflask/collect.py
+++ b/wqflask/wqflask/collect.py
@@ -82,10 +82,17 @@ def collections_add():
lambda _err: tuple(), lambda colls: tuple(colls)) + no_token_get(
f"oauth2/user/collections/{anon_id}/list").either(
lambda _err: tuple(), lambda colls: tuple(colls))
+
+ def __create_new_coll_error__(error):
+ err = process_error(error)
+ flash(f"{err['error']}:{err['error_description']}", "alert-danger")
+ return redirect("/")
+
if len(collections) < 1:
new_coll = client.post(
"oauth2/user/collections/new",
json={
+ "anon_id": str(anon_id),
"name": "Your Default Collection",
"traits": []
}).either(__create_new_coll_error__, lambda coll: coll)