aboutsummaryrefslogtreecommitdiff
path: root/gn3/auth/authorisation/users/views.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-05-11 09:51:52 +0300
committerFrederick Muriuki Muriithi2023-05-11 10:10:27 +0300
commitfe7670fbad187d81e9c395d03d4b3c69a0a6a1f3 (patch)
treecd6c4a0bb782f9454b27528ec36438cf30ba04a4 /gn3/auth/authorisation/users/views.py
parente373450236e05a4be79b42e99615af20e8b8e536 (diff)
downloadgenenetwork3-fe7670fbad187d81e9c395d03d4b3c69a0a6a1f3.tar.gz
auth: Fix bug with migration of user collections
The code, as written previously had a subtle bug - if the user created a new collection before they had tried accessing their list of collections, the older code would not have migrated the older collections. This commit fixes that by enabling the migration of older collections, whether or not the user has created a collection with their new accounts.
Diffstat (limited to 'gn3/auth/authorisation/users/views.py')
-rw-r--r--gn3/auth/authorisation/users/views.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/gn3/auth/authorisation/users/views.py b/gn3/auth/authorisation/users/views.py
index 0a82de3..2b4230e 100644
--- a/gn3/auth/authorisation/users/views.py
+++ b/gn3/auth/authorisation/users/views.py
@@ -13,7 +13,7 @@ from gn3.auth.dictify import dictify
from gn3.auth.db_utils import with_db_connection
from .models import list_users
-from .collections import user_collections, old_user_collections
+from .collections import user_collections
from ..groups.models import user_group as _user_group
from ..resources.models import user_resources as _user_resources
@@ -180,6 +180,4 @@ def list_user_collections() -> Response:
with (require_oauth.acquire("profile user") as the_token,
Redis.from_url(current_app.config["REDIS_URI"],
decode_responses=True) as redisconn):
- return jsonify(
- user_collections(redisconn, the_token.user) or
- old_user_collections(redisconn, the_token.user))
+ return jsonify(user_collections(redisconn, the_token.user))