diff options
Diffstat (limited to 'pyaggr3g470r/__init__.py')
-rw-r--r-- | pyaggr3g470r/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
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 |