Merge pull request #5078 from FinnStutzenstein/fixMaster

Fixed typing from parse_qs
This commit is contained in:
Finn Stutzenstein 2019-10-18 15:15:23 +02:00 committed by GitHub
commit bcba878e18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

1
.gitignore vendored
View File

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

View File

@ -1,6 +1,6 @@
import time import time
from collections import defaultdict 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 urllib.parse import parse_qs
from channels.generic.websocket import AsyncWebsocketConsumer from channels.generic.websocket import AsyncWebsocketConsumer
@ -55,7 +55,9 @@ class SiteConsumer(ProtocollAsyncJsonWebsocketConsumer):
logger.debug(f"connect: denied ({self._id})") logger.debug(f"connect: denied ({self._id})")
return 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: if b"change_id" in query_string:
try: try:
change_id = int(query_string[b"change_id"][0]) change_id = int(query_string[b"change_id"][0])