Skip to content

Commit

Permalink
make anonymous field not required, bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
jtolio committed Jun 17, 2014
1 parent 74f0b78 commit fe17c2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions backend/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class PledgeHandler(webapp2.RequestHandler):
employer=_STR,
target=_STR,
subscribe=dict(type='boolean'),
anonymous=dict(type='boolean'),
anonymous=dict(type='boolean', required=False),
amountCents=dict(type='integer', minimum=100),
pledgeType=dict(enum=model.Pledge.TYPE_VALUES, required=False),
team=dict(type='string', blank=True),
Expand Down Expand Up @@ -162,7 +162,7 @@ def post(self):
'pledgeType', model.Pledge.TYPE_CONDITIONAL),
team=data['team'],
mail_list_optin=data['subscribe'],
anonymous=data['anonymous'])
anonymous=data.get('anonymous', False))

if data['subscribe']:
env.mailing_list_subscriber.Subscribe(
Expand Down
3 changes: 2 additions & 1 deletion backend/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ def create(email, stripe_customer_id, stripe_charge_id,
url_nonce=os.urandom(32).encode("hex"),
anonymous=anonymous)
pledge.put()
TeamTotal.add(team, amount_cents)
if team:
TeamTotal.add(team, amount_cents)
return pledge


Expand Down

0 comments on commit fe17c2d

Please sign in to comment.