Skip to content

Instantly share code, notes, and snippets.

@skyler
Created June 12, 2013 15:27
Show Gist options
  • Save skyler/5766305 to your computer and use it in GitHub Desktop.
Save skyler/5766305 to your computer and use it in GitHub Desktop.
old_code = db.execute(
'''SELECT coupon_code, coupon_offer
FROM surveys
WHERE survey_id = %s''', survey_id).first()
if old_code:
logging.info("Returning old coupon_code %s for survey_id %d and panelist_id %d",
old_code, survey_id, panelist_id)
return dict(coupon_code=old_code['coupon_code'],
coupon_offer=old_code['coupon_offer'],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment