From eed0706433885207ea7ebae208a072f198a04367 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Wed, 23 Apr 2014 21:39:20 +0200 Subject: This fixes #1. --- pyaggr3g470r/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pyaggr3g470r/__init__.py') diff --git a/pyaggr3g470r/__init__.py b/pyaggr3g470r/__init__.py index c429c4de..2f52dc2c 100644 --- a/pyaggr3g470r/__init__.py +++ b/pyaggr3g470r/__init__.py @@ -16,6 +16,14 @@ app.config['SECRET_KEY'] = os.urandom(12) app.config['SQLALCHEMY_DATABASE_URI'] = conf.SQLALCHEMY_DATABASE_URI db = SQLAlchemy(app) +ALLOWED_EXTENSIONS = set(['xml', 'opml']) + +def allowed_file(filename): + """ + Check if the uploaded WSW file is allowed. + """ + return '.' in filename and \ + filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS if not conf.ON_HEROKU: app.config["MAIL_SERVER"] = conf.MAIL_HOST -- cgit