Exemplo n.º 1
0
def add_source(request):
    if request.method == 'POST':
        form=ICalendarEditForm(request.POST)
        if form.is_valid():
            form.save()
            messages.add_message(request, messages.INFO, "Thanks for submitting an iCal!")
            if request.profile.userlevel < 10 :

                mail.send_mail(sender="Events bot ANGRY <*****@*****.**>",
                                            to="The Laziest Louts Ever <*****@*****.**>",
                                            #to="The Laziest Louts Ever <*****@*****.**>",
                                            subject="New Source Added, now get off your ass!",
                                            body="""
New Source! Needs Review: http://events.datacommunitydc.org/sources/manage/

The Angry Server.
                        """)
                return HttpResponseRedirect('/')
            else:
                return HttpResponseRedirect('/sources/manage/')

        else:
            return render_to_response('sources/add.html', locals(), context_instance=RequestContext(request))


    form=ICalendarEditForm()
    return render_to_response('sources/add.html', locals(), context_instance=RequestContext(request))
Exemplo n.º 2
0
def add_source(request):
    if request.method == 'POST':
        form=ICalendarEditForm(request.POST)
        if form.is_valid():
            form.save()
            messages.add_message(request, messages.INFO, "Thanks for submitting an iCal!")
            if request.profile.userlevel < 10 :
                return HttpResponseRedirect('/')
            else:
                return HttpResponseRedirect('/sources/manage/')
            
        else:
            return render_to_response('sources/add.html', locals(), context_instance=RequestContext(request))
    
    
    form=ICalendarEditForm()
    return render_to_response('sources/add.html', locals(), context_instance=RequestContext(request))
Exemplo n.º 3
0
def add_source(request):
    if request.method == 'POST':
        form = ICalendarEditForm(request.POST)
        if form.is_valid():
            form.save()
            messages.add_message(request, messages.INFO,
                                 "Thanks for submitting an iCal!")
            if request.profile.userlevel < 10:

                mail.send_mail(
                    sender="Events bot ANGRY <*****@*****.**>",
                    to="The Laziest Louts Ever <*****@*****.**>",
                    #to="The Laziest Louts Ever <*****@*****.**>",
                    subject="New Source Added, now get off your ass!",
                    body="""
New Source! Needs Review: http://events.datacommunitydc.org/sources/manage/

The Angry Server.
                        """)
                return HttpResponseRedirect('/')
            else:
                return HttpResponseRedirect('/sources/manage/')

        else:
            return render_to_response('sources/add.html',
                                      locals(),
                                      context_instance=RequestContext(request))

    form = ICalendarEditForm()
    return render_to_response('sources/add.html',
                              locals(),
                              context_instance=RequestContext(request))
Exemplo n.º 4
0
def add_source(request):
    if request.method == 'POST':
        form = ICalendarEditForm(request.POST)
        if form.is_valid():
            form.save()
            messages.add_message(request, messages.INFO,
                                 "Thanks for submitting an iCal!")
            if request.profile.userlevel < 10:
                return HttpResponseRedirect('/')
            else:
                return HttpResponseRedirect('/sources/manage/')

        else:
            return render_to_response('sources/add.html',
                                      locals(),
                                      context_instance=RequestContext(request))

    form = ICalendarEditForm()
    return render_to_response('sources/add.html',
                              locals(),
                              context_instance=RequestContext(request))