def lookup(): try: name = request.form['donor'] donor = Donor.get(name=name) donations = Donation.get(donor=donor) logging.info(donations) #donor_output = [donation for donation in donations] #logging.info(donor_output) #logging.info(session['donation']) #return donor_output except Exception as e: logging.info(e) return render_template('get_donations.jinja2')
def retrieve(): code = request.args.get('code', None) if code is None: return render_template('retrieve.jinja2') else: try: saved_donation = Donation.get(Donation.code == code) except Donation.DoesNotExist: return render_template(retrieve.jinja2, error="Code not found.") session['donation'] = saved_donation.value return redirect(url_for('submit'))