Beispiel #1
0
def acceptTeam(request):
    """
    チームに招待された被招待者が承認する
    """
    logger.info('チーム招待被招待者承認')
    c = {}
    if request.method == "POST":
        team_id = request.POST["team_id"]

    if team_id:
        team = SERVICES.selectTeamById(team_id)
        if team is None:
            return index(request)
    else:
        return index(request)

    result = SERVICES.acceptTeamInvited(request.user, team)

    if result == 'success':
        c.update({'form_message': MSGS.INVITE_ACCEPT_SUCCESS})
    else:
        c.update({'form_message':MSGS.INVITE_ACCEPT_FAIL})


    return show(request, c)
Beispiel #2
0
def deleteTeam(request):
    """
    チームを削除する
    """
    logger.info('チーム削除')
    c = {}

    if request.method == "POST":
        team_id = request.POST["object_id"]

    team = SERVICES.selectTeamById(team_id)

    if team:
        result = SERVICES.deleteTeam(team)

    if result == 'success':
        c.update({'team_delete_message': MSGS.DELETE_MEMBER_SUCCESS})
    else:
        c.update({'team_delete_message':MSGS.DELETE_MEMBER_FAIL})

    return show(request, c)
Beispiel #3
0
def deleteMember(request):
    """
    チームからメンバーを削除する
    """
    logger.info('チームメンバ^-削除')
    c = {}

    if request.method == "POST":
        username = request.POST["object_id"]
        team_id = request.POST["delete_from_id"]

    user = SERVICES.selectUserById(username)
    team = SERVICES.selectTeamById(team_id)

    if user and team:
        result = SERVICES.deleteMember(user, team)

    if result == 'success':
        c.update({'list_form_message': MSGS.DELETE_MEMBER_SUCCESS})
    else:
        c.update({'list_form_message':MSGS.DELETE_MEMBER_FAIL})


    return show(request, c)