예제 #1
0
파일: streams.py 프로젝트: acemaster/zulip
def update_stream_backend(request, user_profile, stream_id,
                          description=REQ(validator=check_string, default=None),
                          is_private=REQ(validator=check_bool, default=None),
                          new_name=REQ(validator=check_string, default=None)):
    # type: (HttpRequest, UserProfile, int, Optional[Text], Optional[bool], Optional[Text]) -> HttpResponse
    stream = get_and_validate_stream_by_id(stream_id, user_profile.realm)
    stream_name = stream.name

    if description is not None:
        do_change_stream_description(user_profile.realm, stream_name, description)
    if stream_name is not None and new_name is not None:
        do_rename_stream(user_profile.realm, stream_name, new_name)
    if is_private is not None:
        if is_private:
            do_make_stream_private(user_profile.realm, stream_name)
        else:
            do_make_stream_public(user_profile, user_profile.realm, stream_name)
    return json_success()
예제 #2
0
def update_stream_backend(request,
                          user_profile,
                          stream_name,
                          description=REQ(validator=check_string,
                                          default=None),
                          is_private=REQ(validator=check_bool, default=None),
                          new_name=REQ(validator=check_string, default=None)):
    # type: (HttpRequest, UserProfile, Text, Optional[Text], Optional[bool], Optional[Text]) -> HttpResponse
    if description is not None:
        do_change_stream_description(user_profile.realm, stream_name,
                                     description)
    if stream_name is not None and new_name is not None:
        do_rename_stream(user_profile.realm, stream_name, new_name)
    if is_private is not None:
        if is_private:
            do_make_stream_private(user_profile.realm, stream_name)
        else:
            do_make_stream_public(user_profile, user_profile.realm,
                                  stream_name)
    return json_success()
예제 #3
0
파일: streams.py 프로젝트: zebesta/zulip
def json_make_stream_private(request, user_profile, stream_name=REQ()):
    # type: (HttpRequest, UserProfile, text_type) -> HttpResponse
    do_make_stream_private(user_profile.realm, stream_name)
    return json_success()
예제 #4
0
파일: streams.py 프로젝트: bkeyvani/zulip
def json_make_stream_private(request, user_profile, stream_name=REQ()):
    # type: (HttpRequest, UserProfile, str) -> HttpResponse
    do_make_stream_private(user_profile.realm, stream_name)
    return json_success()
예제 #5
0
파일: streams.py 프로젝트: kevinwmx/zulip
def json_make_stream_private(request, user_profile, stream_name=REQ):
    return json_success(do_make_stream_private(user_profile.realm,
                                               stream_name))
예제 #6
0
파일: streams.py 프로젝트: anteq/zulip
def json_make_stream_private(request, user_profile, stream_name=REQ):
    return json_success(do_make_stream_private(user_profile.realm, stream_name))