diff options
| author | Alexis Metaireau <alexis@notmyidea.org> | 2015-05-20 18:03:50 +0200 |
|---|---|---|
| committer | Alexis Metaireau <alexis@notmyidea.org> | 2015-05-20 18:03:50 +0200 |
| commit | 84aafc850e8262c7f8499d2919825a21c8278dde (patch) | |
| tree | c18cf1216721ed7f3c6e4203a6d25e19888e0cdc /budget | |
| parent | 55505b230ba6b3e48599634538323d288ce739e1 (diff) | |
| parent | df215cbb796e5320404ea904b7e2feca922d5cbc (diff) | |
| download | ihatemoney-mirror-84aafc850e8262c7f8499d2919825a21c8278dde.zip ihatemoney-mirror-84aafc850e8262c7f8499d2919825a21c8278dde.tar.gz ihatemoney-mirror-84aafc850e8262c7f8499d2919825a21c8278dde.tar.bz2 | |
Merge pull request #121 from JocelynDelalande/deprecated-default-mail-sender
nicely deprecates DEFAULT_MAIL_SENDER
Diffstat (limited to 'budget')
| -rw-r--r-- | budget/default_settings.py | 2 | ||||
| -rw-r--r-- | budget/requirements.txt | 2 | ||||
| -rw-r--r-- | budget/run.py | 14 |
3 files changed, 16 insertions, 2 deletions
diff --git a/budget/default_settings.py b/budget/default_settings.py index 111abf2..394ab00 100644 --- a/budget/default_settings.py +++ b/budget/default_settings.py @@ -3,7 +3,7 @@ SQLALCHEMY_DATABASE_URI = 'sqlite:///budget.db' SQLACHEMY_ECHO = DEBUG SECRET_KEY = "tralala" -DEFAULT_MAIL_SENDER = ("Budget manager", "budget@notmyidea.org") +MAIL_DEFAULT_SENDER = ("Budget manager", "budget@notmyidea.org") try: from settings import * diff --git a/budget/requirements.txt b/budget/requirements.txt index 87d8966..5d7433a 100644 --- a/budget/requirements.txt +++ b/budget/requirements.txt @@ -1,7 +1,7 @@ flask>=0.9 flask-wtf==0.8 flask-sqlalchemy -flask-mail +flask-mail>=0.8 flask-babel flask-rest jinja2==2.6 diff --git a/budget/run.py b/budget/run.py index 845192d..1a65022 100644 --- a/budget/run.py +++ b/budget/run.py @@ -1,3 +1,5 @@ +import warnings + from flask import Flask, g, request, session from flask.ext.babel import Babel from raven.contrib.flask import Sentry @@ -9,6 +11,18 @@ from api import api app = Flask(__name__) app.config.from_object("default_settings") +# Deprecations +if 'DEFAULT_MAIL_SENDER' in app.config: + # Since flask-mail 0.8 + warnings.warn( + "DEFAULT_MAIL_SENDER is deprecated in favor of MAIL_DEFAULT_SENDER" + +" and will be removed in further version", + UserWarning + ) + if not 'MAIL_DEFAULT_SENDER' in app.config: + app.config['MAIL_DEFAULT_SENDER'] = DEFAULT_MAIL_SENDER + + app.register_blueprint(main) app.register_blueprint(api) |
