Example #1
0
def remove_default_stream(request: HttpRequest,
                          user_profile: UserProfile,
                          stream_name: str=REQ()) -> HttpResponse:
    (stream, recipient, sub) = access_stream_by_name(user_profile, stream_name,
                                                     allow_realm_admin=True)
    do_remove_default_stream(stream)
    return json_success()
Example #2
0
def remove_default_stream(request: HttpRequest,
                          user_profile: UserProfile,
                          stream_name: str=REQ()) -> HttpResponse:
    (stream, recipient, sub) = access_stream_by_name(user_profile, stream_name,
                                                     allow_realm_admin=True)
    do_remove_default_stream(stream)
    return json_success()
Example #3
0
def remove_default_stream(request: HttpRequest,
                          user_profile: UserProfile,
                          stream_id: int=REQ(validator=check_int)) -> HttpResponse:
    (stream, recipient, sub) = access_stream_by_id(
        user_profile,
        stream_id,
        allow_realm_admin=True,
    )
    do_remove_default_stream(stream)
    return json_success()
Example #4
0
def update_stream_backend(request, user_profile, stream_name,
                          description=REQ(validator=check_string, default=None),
                          is_default=REQ(validator=check_bool, default=None)):
    # type: (HttpRequest, UserProfile, str, Optional[str], Optional[bool]) -> HttpResponse
    if description is not None:
       do_change_stream_description(user_profile.realm, stream_name, description)
    if is_default is not None:
        if is_default:
            do_add_default_stream(user_profile.realm, stream_name)
        else:
            do_remove_default_stream(user_profile.realm, stream_name)
    return json_success({})
Example #5
0
def remove_default_stream(request, user_profile, stream_name=REQ()):
    # type: (HttpRequest, UserProfile, text_type) -> HttpResponse
    do_remove_default_stream(user_profile.realm, stream_name)
    return json_success()
Example #6
0
def remove_default_stream(request, user_profile, stream_name=REQ()):
    # type: (HttpRequest, UserProfile, str) -> HttpResponse
    do_remove_default_stream(user_profile.realm, stream_name)
    return json_success()
Example #7
0
def remove_default_stream(request, user_profile, stream_name=REQ()):
    # type: (HttpRequest, UserProfile, Text) -> HttpResponse
    (stream, recipient, sub) = access_stream_by_name(user_profile, stream_name)
    do_remove_default_stream(stream)
    return json_success()
Example #8
0
def remove_default_stream(request, user_profile, stream_name=REQ()):
    # type: (HttpRequest, UserProfile, Text) -> HttpResponse
    (stream, recipient, sub) = access_stream_by_name(user_profile, stream_name)
    do_remove_default_stream(stream)
    return json_success()
Example #9
0
def remove_default_stream(request, user_profile, stream_name=REQ):
    return json_success(
        do_remove_default_stream(user_profile.realm, stream_name))
Example #10
0
def remove_default_stream(request, user_profile, stream_name=REQ):
    return json_success(do_remove_default_stream(user_profile.realm, stream_name))