mypy: Fix QuerySet -> QuerySet[Subscription].

This commit is contained in:
Steve Howell 2017-10-30 06:54:22 -07:00 committed by Tim Abbott
parent faba34dae4
commit 1ac2360d2e
1 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ from zerver.models import (
)
def get_active_subscriptions_for_stream_id(stream_id):
# type: (int) -> QuerySet
# type: (int) -> QuerySet[Subscription]
return Subscription.objects.filter(
recipient__type=Recipient.STREAM,
recipient__type_id=stream_id,
@ -18,7 +18,7 @@ def get_active_subscriptions_for_stream_id(stream_id):
)
def get_active_subscriptions_for_stream_ids(stream_ids):
# type: (List[int]) -> QuerySet
# type: (List[int]) -> QuerySet[Subscription]
return Subscription.objects.filter(
recipient__type=Recipient.STREAM,
recipient__type_id__in=stream_ids,
@ -26,14 +26,14 @@ def get_active_subscriptions_for_stream_ids(stream_ids):
)
def get_stream_subscriptions_for_user(user_profile):
# type: (UserProfile) -> QuerySet
# type: (UserProfile) -> QuerySet[Subscription]
return Subscription.objects.filter(
user_profile=user_profile,
recipient__type=Recipient.STREAM,
)
def get_stream_subscriptions_for_users(user_profiles):
# type: (List[UserProfile]) -> QuerySet
# type: (List[UserProfile]) -> QuerySet[Subscription]
return Subscription.objects.filter(
user_profile__in=user_profiles,
recipient__type=Recipient.STREAM,