Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested fixes by iCR, OpenRefactory, Inc. #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pypistats/application.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""PyPIStats application."""
from celery import Task
from flask import Flask
from flask_wtf.csrf import CSRFProtect

from pypistats import views
from pypistats.config import DevConfig
Expand All @@ -12,7 +13,10 @@

def create_app(config_object=DevConfig):
"""Create the application."""
# OpenRefactory Warning: The 'Flask' method creates a Flask app
# without Cross-Site Request Forgery (CSRF) protection.
app = Flask(__name__.split(".")[0])
CSRFProtect(app)
app.config.from_object(config_object)
register_extensions(app)
register_blueprints(app)
Expand Down