Skip to content

Commit

Permalink
legacy_urls: Add type annotation to legacy_urls.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
PIG208 authored and timabbott committed Aug 13, 2022
1 parent 8fae87e commit 9293116
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions zproject/legacy_urls.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -8,7 +10,7 @@

# 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
Expand Down

0 comments on commit 9293116

Please sign in to comment.