Exemple #1
0
def bounced_email(request, username):
    person = get_object_or_404(Person, username=username)

    leader_list = []
    for project in person.projects.filter(is_active=True):
        for leader in project.leaders.filter(is_active=True,
                                             login_enabled=True):
            leader_list.append({'project': project, 'leader': leader})

    if request.method == 'POST':
        person.lock()
        send_bounced_warning(person, leader_list)
        messages.success(
            request,
            "%s's account has been locked and emails have been sent" % person)
        common.log.change(person,
                          'Emails sent to project leaders and account locked')
        return HttpResponseRedirect(person.get_absolute_url())

    leader_list = LeaderTable(leader_list)
    tables.RequestConfig(request).configure(leader_list)

    return render(template_name='karaage/people/person_bounced_email.html',
                  context=locals(),
                  request=request)
Exemple #2
0
def bounced_email(request, username):
    person = get_object_or_404(Person, username=username)
    if request.method == 'POST':
        person.lock()
        send_bounced_warning(person)
        messages.success(
            request,
            "%s's account has been locked and emails have been sent" % person)
        common.log.change(
            person,
            'Emails sent to project leaders and account locked')
        for ua in person.account_set.all():
            ua.change_shell(ua.previous_shell)
            ua.change_shell(settings.BOUNCED_SHELL)
        return HttpResponseRedirect(person.get_absolute_url())

    leader_list = Person.objects \
        .filter(
            groups__members=person,
            groups__project__is_active=True) \
        .filter(is_active=True)

    leader_list = PersonTable(
        leader_list, prefix="leader-")

    return render_to_response(
        'karaage/people/person_bounced_email.html',
        locals(),
        context_instance=RequestContext(request))
Exemple #3
0
def bounced_email(request, username):
    person = get_object_or_404(Person, username=username)

    leader_list = []
    for project in person.projects.filter(is_active=True):
        for leader in project.leaders.filter(
                is_active=True, login_enabled=True):
            leader_list.append({'project': project, 'leader': leader})

    if request.method == 'POST':
        person.lock()
        send_bounced_warning(person, leader_list)
        messages.success(
            request,
            "%s's account has been locked and emails have been sent" % person)
        common.log.change(
            person,
            'Emails sent to project leaders and account locked')
        return HttpResponseRedirect(person.get_absolute_url())

    leader_list = LeaderTable(leader_list)
    tables.RequestConfig(request).configure(leader_list)

    return render_to_response(
        'karaage/people/person_bounced_email.html',
        locals(),
        context_instance=RequestContext(request))
Exemple #4
0
def bounced_email(request, username):
    person = get_object_or_404(Person, username=username)
    if request.method == 'POST':
        person.lock()
        send_bounced_warning(person)
        messages.success(
            request,
            "%s's account has been locked and emails have been sent" % person)
        common.log.change(person,
                          'Emails sent to project leaders and account locked')
        for ua in person.account_set.all():
            ua.change_shell(ua.previous_shell)
            ua.change_shell(settings.BOUNCED_SHELL)
        return HttpResponseRedirect(person.get_absolute_url())

    leader_list = Person.objects \
        .filter(
            groups__members=person,
            groups__project__is_active=True) \
        .filter(is_active=True)

    leader_list = PersonTable(leader_list, prefix="leader-")

    return render_to_response('karaage/people/person_bounced_email.html',
                              locals(),
                              context_instance=RequestContext(request))
def bounced_email(request, username):
    person = get_object_or_404(Person, username=username)
    if request.method == 'POST':
        person.lock()
        send_bounced_warning(person)
        messages.success(request, "%s's account has been locked and emails have been sent" % person)
        log(request.user, person, 2, 'Emails sent to project leaders and account locked')
        for ua in person.account_set.all():
            ua.change_shell(ua.previous_shell)
            ua.change_shell(settings.BOUNCED_SHELL)
        return HttpResponseRedirect(person.get_absolute_url())

    return render_to_response('people/bounced_email.html', locals(), context_instance=RequestContext(request))