Files @ 6fe13959a3b3
Branch filter:

Location: website/www/conservancy/apps/supporter/views.py

brett
supporter: Support donors upgrading to supporters.

With a valid URL, a past donor can upgrade to a supporter by donating
the rest of the amount. Django validates the data and, if it passes,
puts it in the form. The JavaScript does most of the work from there.
1
2
3
4
5
6
7
8
9
import conservancy

def index(request):
    partial_amount = conservancy.param_if_valid(request.GET, 'upgrade', 'upgrade_id', 0)
    context = {
        'partial_amount': partial_amount,
        'minimum_amount': 120 - partial_amount,
    }
    return conservancy.render_template_with_context(request, "supporter/index.html", context)