Пример #1
0
def leave_team(request, org, team_id, couch_user_id):
    def remove_user():
        team = Team.get(team_id)
        if team:
            team.remove_member(couch_user_id)
    repeat(remove_user, 3)
    if 'redirect_url' in request.POST:
        return HttpResponseRedirect(reverse(request.POST['redirect_url'], args=(org, team_id)))
Пример #2
0
def leave_group(request, domain, group_id, couch_user_id):
    def remove_user():
        group = Group.get(group_id)
        if group:
            group.remove_user(couch_user_id)
    repeat(remove_user, 3)
    if 'redirect_url' in request.POST:
        return HttpResponseRedirect(reverse(request.POST['redirect_url'], args=(domain, group_id)))
    else:
        return HttpResponseRedirect(reverse("group_membership", args=(domain, couch_user_id)))
Пример #3
0
def join_group(request, domain, group_id, couch_user_id):
    def add_user():
        group = Group.get(group_id)
        if group:
            group.add_user(couch_user_id)

    repeat(add_user, 3)
    if "redirect_url" in request.POST:
        return HttpResponseRedirect(reverse(request.POST["redirect_url"], args=(domain, group_id)))
    else:
        return HttpResponseRedirect(reverse("group_membership", args=(domain, couch_user_id)))
Пример #4
0
def leave_group(request, domain, group_id, couch_user_id):
    def remove_user():
        group = Group.get(group_id)
        if group:
            group.remove_user(couch_user_id)

    repeat(remove_user, 3)
    if 'redirect_url' in request.POST:
        return HttpResponseRedirect(
            reverse(request.POST['redirect_url'], args=(domain, group_id)))
    else:
        return HttpResponseRedirect(
            reverse("group_membership", args=(domain, couch_user_id)))