auth: Avoid unchecked casts.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-06-22 15:39:19 -07:00
committed by Tim Abbott
parent 5733a1bcd4
commit f6c73ed45a
3 changed files with 6 additions and 9 deletions

View File

@@ -2,7 +2,7 @@ import logging
import os
import urllib
from functools import wraps
from typing import Any, Dict, List, Mapping, Optional, cast
from typing import Any, Dict, List, Mapping, Optional
import jwt
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
@@ -224,7 +224,7 @@ def register_remote_user(request: HttpRequest, result: ExternalAuthResult) -> Ht
# We have verified the user controls an email address, but
# there's no associated Zulip user account. Consider sending
# the request to registration.
kwargs = cast(Dict[str, Any], result.copy_data_dict())
kwargs: Dict[str, Any] = dict(result.data_dict)
# maybe_send_to_registration doesn't take these arguments, so delete them.
kwargs.pop('subdomain', None)
kwargs.pop('redirect_to', None)