Move each flask module into a Blueprint and have CSRF protection only on the API blueprint

This commit is contained in:
Joseph Schorr 2013-12-30 17:05:27 -05:00
parent b598c7ec85
commit 310c98df50
8 changed files with 174 additions and 162 deletions

View file

@ -1,7 +1,7 @@
import logging
import stripe
from flask import request, make_response
from flask import request, make_response, Blueprint
from data import model
from app import app
@ -11,8 +11,9 @@ from util.email import send_invoice_email
logger = logging.getLogger(__name__)
webhooks = Blueprint('webhooks', __name__)
@app.route('/webhooks/stripe', methods=['POST'])
@webhooks.route('/stripe', methods=['POST'])
def stripe_webhook():
request_data = request.get_json()
logger.debug('Stripe webhook call: %s' % request_data)