diff --git a/imgee/__init__.py b/imgee/__init__.py index 01b51f26..14f6b245 100644 --- a/imgee/__init__.py +++ b/imgee/__init__.py @@ -30,18 +30,18 @@ def mkdir_p(dirname): os.makedirs(dirname) -def error403(error): - return redirect(url_for('login')) - - # Configure the app coaster.app.init_app(app) migrate = Migrate(app, db) baseframe.init_app(app, requires=['baseframe', 'picturefill', 'imgee']) -app.error_handlers[403] = error403 lastuser.init_app(app) lastuser.init_usermanager(UserManager(db, models.User)) + +@app.errorhandler(403) +def error403(error): + return redirect(url_for('login')) + if app.config.get('MEDIA_DOMAIN') and ( app.config['MEDIA_DOMAIN'].startswith('http:') or app.config['MEDIA_DOMAIN'].startswith('https:')):