Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Clean up JSON endpoint for homepage form #4617

Merged
merged 1 commit into from
Sep 10, 2017

Conversation

chadwhitacre
Copy link
Contributor

@chadwhitacre chadwhitacre commented Sep 10, 2017

#4604#4613

  • fix bug with receipt_url and pfos not existing
  • harmonize the _send call sig w/ _charge
  • change base to new-homepage

@chadwhitacre chadwhitacre changed the title Clean up the homepage API Clean up JSON endpoint for homepage form Sep 10, 2017
return {'parsed': parsed, 'errors': errors}
if parsed['email_address'] and not errors:
_send(app, parsed['email_address'], pfos)
return {'errors': errors, 'receipt_url': pfos.receipt_url}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's an early parse error then pfos is a null pointer here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parsed = {} # no need to populate form anymore
return {'parsed': parsed, 'errors': errors}
if parsed['email_address'] and not errors:
_send(app, parsed['email_address'], pfos)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make pfos the second arg to match _charge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chadwhitacre
Copy link
Contributor Author

Rebased, squashed, tests fixed (hopefully Travis agrees). Was 81711a8.

@chadwhitacre chadwhitacre force-pushed the new-homepage-api-cleanups branch from 81711a8 to c79a871 Compare September 10, 2017 09:58
@chadwhitacre
Copy link
Contributor Author

🚨 Self-merge license 🚨

@chadwhitacre chadwhitacre merged commit e356cf1 into new-homepage-wireup Sep 10, 2017
@chadwhitacre chadwhitacre deleted the new-homepage-api-cleanups branch September 10, 2017 17:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant