From 3f41890541ca76efd5bba1c4083f628cb878b17e Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Fri, 18 Oct 2019 14:41:55 +0200 Subject: [PATCH] Fixed typing from parse_qs --- .gitignore | 1 + openslides/utils/consumers.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2acccdaf7..be5101843 100644 --- a/.gitignore +++ b/.gitignore @@ -75,6 +75,7 @@ client/typings client/yarn.lock package-lock.json client/package-lock.json +cypress.json # System Files client/.DS_Store diff --git a/openslides/utils/consumers.py b/openslides/utils/consumers.py index 21e9a8c98..f8f7b5bfe 100644 --- a/openslides/utils/consumers.py +++ b/openslides/utils/consumers.py @@ -1,6 +1,6 @@ import time from collections import defaultdict -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Optional, cast from urllib.parse import parse_qs from channels.generic.websocket import AsyncWebsocketConsumer @@ -55,7 +55,9 @@ class SiteConsumer(ProtocollAsyncJsonWebsocketConsumer): logger.debug(f"connect: denied ({self._id})") return - query_string = parse_qs(self.scope["query_string"]) + query_string = cast( + Dict[bytes, List[bytes]], parse_qs(self.scope["query_string"]) + ) if b"change_id" in query_string: try: change_id = int(query_string[b"change_id"][0])