Fix annotations clashing with Stream model fields.

This commit is contained in:
Eklavya Sharma
2016-06-13 13:44:33 +05:30
parent 1ec7e124c7
commit 6f5ed6e7c9
4 changed files with 6 additions and 6 deletions

View File

@@ -114,21 +114,21 @@ def gather_new_users(user_profile, threshold):
return len(user_names), user_names
def gather_new_streams(user_profile, threshold):
# type: (UserProfile, datetime.datetime) -> Tuple[int, Dict[str, List[str]]]
# type: (UserProfile, datetime.datetime) -> Tuple[int, Dict[str, List[text_type]]]
if user_profile.realm.domain == "mit.edu":
new_streams = [] # type: List[Stream]
else:
new_streams = list(get_active_streams(user_profile.realm).filter(
invite_only=False, date_created__gt=threshold))
base_url = "https://%s/#narrow/stream/" % (settings.EXTERNAL_HOST,)
base_url = u"https://%s/#narrow/stream/" % (settings.EXTERNAL_HOST,)
streams_html = []
streams_plain = []
for stream in new_streams:
narrow_url = base_url + hashchange_encode(stream.name)
stream_link = "<a href='%s'>%s</a>" % (narrow_url, stream.name)
stream_link = u"<a href='%s'>%s</a>" % (narrow_url, stream.name)
streams_html.append(stream_link)
streams_plain.append(stream.name)

View File

@@ -379,7 +379,7 @@ class AuthedTestCase(TestCase):
# Subscribe to a stream directly
def subscribe_to_stream(self, email, stream_name, realm=None):
# type: (str, str, Optional[Realm]) -> None
# type: (text_type, text_type, Optional[Realm]) -> None
if realm is None:
realm = get_realm(resolve_email_to_domain(email))
stream = get_stream(stream_name, realm)

View File

@@ -461,7 +461,7 @@ class StreamAdminTest(AuthedTestCase):
class DefaultStreamTest(AuthedTestCase):
def get_default_stream_names(self, realm):
# type: (Realm) -> Set[str]
# type: (Realm) -> Set[text_type]
streams = get_default_streams_for_realm(realm)
stream_names = [s.name for s in streams]
return set(stream_names)

View File

@@ -737,7 +737,7 @@ def home(request):
request._email = request.user.email
request.client = get_client("website")
narrow = [] # type: List[List[str]]
narrow = [] # type: List[List[text_type]]
narrow_stream = None
narrow_topic = request.GET.get("topic")
if request.GET.get("stream"):