custom_profile_fields: Replace a type: ignore with an assert.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-06-22 21:50:30 -07:00 committed by Tim Abbott
parent a3a39494e3
commit 1d545efac2

View File

@ -98,8 +98,8 @@ def create_realm_custom_profile_field(request: HttpRequest,
validate_custom_profile_field(name, hint, field_type, field_data)
try:
if is_default_external_field(field_type, field_data):
field_subtype: str = ''
field_subtype = field_data['subtype'] # type: ignore[assignment] # key for "Union[Dict[str, str], str]" can be str
field_subtype = field_data['subtype']
assert isinstance(field_subtype, str)
field = try_add_realm_default_custom_profile_field(
realm=user_profile.realm,
field_subtype=field_subtype,