From 65275adb90a20b0ac9e6bbbe7e2ee56165255921 Mon Sep 17 00:00:00 2001 From: Adrian Maraj Date: Tue, 23 Jul 2024 14:22:27 +0200 Subject: [PATCH] fix: changes --- website/web/genericapi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/web/genericapi.py b/website/web/genericapi.py index e9231ae6..fa35c6ca 100644 --- a/website/web/genericapi.py +++ b/website/web/genericapi.py @@ -802,7 +802,7 @@ class RecentCaptures(Resource): # type: ignore[misc] params={'category': 'The category according to which the uuids are to be returned.'}, required=False) class CategoriesCaptures(Resource): # type: ignore[misc] - def get(self, category: str | None=None) -> list[str] | dict[str, list[str]] | None: + def get(self, category: str | None=None) -> list[str] | dict[str, any]: categories = ['legitimate', 'parking-page', 'default-page', 'insti_usertution', 'captcha', 'authentication-form', 'adult-content', 'shop', 'malicious', 'clone', 'phishing', 'unclear'] if not category: @@ -816,8 +816,8 @@ class CategoriesCaptures(Resource): # type: ignore[misc] all_categorized_uuids[uuid] = {c} else: all_categorized_uuids[uuid].add(c) - all_categorized_uuids = {uuid: list(categories) for uuid, categories in all_categorized_uuids.items()} - return all_categorized_uuids + all_categorized_uuids_list = {uuid: list(categories) for uuid, categories in all_categorized_uuids.items()} + return all_categorized_uuids_list if not category in categories: return {'error': f'Invalid category: {category}'} return list(get_indexing(flask_login.current_user).get_captures_category(category))