Fix bug allowing subscribing to a stream twice.

(imported from commit c49b7c8ec49fd71bb1e1f1226d9e126d4d0987df)
This commit is contained in:
Tim Abbott 2012-10-19 17:55:49 -04:00
parent 61a33f4c4d
commit a8ee0ecc69

View File

@ -584,7 +584,7 @@ def json_add_subscription(request):
def add_subscriptions_backend(request, user_profile, streams):
subscribed = []
already_subscribed = []
for stream_name in streams:
for stream_name in list(set(streams)):
stream = create_stream_if_needed(user_profile.realm, stream_name)
recipient = Recipient.objects.get(type_id=stream.id,
type=Recipient.STREAM)