website/www/conservancy/apps/supporter/views.py
Brett Smith 6fe13959a3 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.
2016-12-02 12:50:21 -05:00

9 lines
335 B
Python

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)