legacy_urls: Add type annotation to legacy_urls.

Mypy previously infers this to be `List[URLPattern]` which is
incompatible with other urls lists that we concatenate this with.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
Zixuan James Li 2022-07-29 16:53:37 -04:00 committed by Tim Abbott
parent 8fae87e2df
commit 929311642b
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,6 @@
from django.urls import path
from typing import List, Union
from django.urls import URLPattern, URLResolver, path
import zerver.views
import zerver.views.auth
@ -8,7 +10,7 @@ import zerver.views.tutorial
# Future endpoints should add to urls.py, which includes these legacy URLs
legacy_urls = [
legacy_urls: List[Union[URLPattern, URLResolver]] = [
# These are json format views used by the web client. They require a logged in browser.
# We should remove this endpoint and all code related to it.
# It returns a 404 if the stream doesn't exist, which is confusing