From b68291da7006b579da7c71c954e96c18d02ddddc Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 21 Aug 2024 17:17:02 +0000 Subject: Only import anonymous collections if they contain traits --- gn_auth/auth/authorisation/users/collections/views.py | 1 + 1 file changed, 1 insertion(+) (limited to 'gn_auth/auth/authorisation/users/collections') diff --git a/gn_auth/auth/authorisation/users/collections/views.py b/gn_auth/auth/authorisation/users/collections/views.py index eeae91d..f619c3d 100644 --- a/gn_auth/auth/authorisation/users/collections/views.py +++ b/gn_auth/auth/authorisation/users/collections/views.py @@ -113,6 +113,7 @@ def import_anonymous() -> Response: anon_id = UUID(request.json.get("anon_id"))#type: ignore[union-attr] anon_colls = user_collections(redisconn, User( anon_id, "anon@ymous.user", "Anonymous User")) + anon_colls = tuple(coll for coll in anon_colls if coll['num_members'] > 0) save_collections( redisconn, token.user, -- cgit v1.2.3