slack_message_conversion: Clean up type ignores.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg 2019-08-09 15:30:33 -07:00
parent 17acf95437
commit e417d3a040
1 changed files with 3 additions and 2 deletions

View File

@ -115,8 +115,9 @@ def convert_to_zulip_markdown(text: str, users: List[ZerverFieldsT],
def get_user_mentions(token: str, users: List[ZerverFieldsT],
added_users: AddedUsersT) -> Tuple[str, Optional[int]]:
slack_usermention_match = re.search(SLACK_USERMENTION_REGEX, token, re.VERBOSE)
short_name = slack_usermention_match.group(4) # type: ignore # slack_usermention_match exists and is not None
slack_id = slack_usermention_match.group(2) # type: ignore # slack_usermention_match exists and is not None
assert slack_usermention_match is not None
short_name = slack_usermention_match.group(4)
slack_id = slack_usermention_match.group(2)
for user in users:
if (user['id'] == slack_id and user['name'] == short_name and short_name) or \
(user['id'] == slack_id and short_name is None):