@handle_response_format
@treeio_login_required
def stream_delete(request, stream_id, response_format='html'):
    "Delete stream page"

    stream = get_object_or_404(MessageStream, pk=stream_id)
    if not request.user.profile.has_permission(stream, mode="w"):
        return user_denied(request, message="You don't have access to this Stream",
                           response_format=response_format)

    if request.POST:
        if 'delete' in request.POST:
            if request.POST in 'trash':
                stream.trash = True
                stream.save()
            else:
                stream.delete()
            return HttpResponseRedirect('/messaging/')
        elif 'cancel' in request.POST:
            return HttpResponseRedirect(reverse('messaging_stream_view', args=[stream.id]))

    context = _get_default_context(request)
    context.update({'stream': stream})

    return render_to_response('messaging/stream_delete', context,
                              context_instance=RequestContext(request),
                              response_format=response_format)
dataset/ETHPy150Open treeio/treeio/treeio/messaging/views.py/stream_delete/swapped operands of `in`