Fixed typing from parse_qs

This commit is contained in:
FinnStutzenstein 2019-10-18 14:41:55 +02:00
parent d49f6124d3
commit 3f41890541
2 changed files with 5 additions and 2 deletions

1
.gitignore vendored
View File

@ -75,6 +75,7 @@ client/typings
client/yarn.lock
package-lock.json
client/package-lock.json
cypress.json
# System Files
client/.DS_Store

View File

@ -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])