mirror of https://github.com/zulip/zulip.git
get_stream: Fetch the realm object as well.
(imported from commit 065ae574cb933cfc48371efd4327e70d37184dd4)
This commit is contained in:
parent
c6c3cda089
commit
c0fece1cbd
|
@ -179,7 +179,8 @@ def get_stream(stream_name, realm):
|
||||||
else:
|
else:
|
||||||
realm_id = realm
|
realm_id = realm
|
||||||
try:
|
try:
|
||||||
return Stream.objects.get(name__iexact=stream_name.strip(), realm_id=realm_id)
|
return Stream.objects.select_related("realm").get(
|
||||||
|
name__iexact=stream_name.strip(), realm_id=realm_id)
|
||||||
except Stream.DoesNotExist:
|
except Stream.DoesNotExist:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue