Skip to content

Commit

Permalink
Get app config from inside a request context
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrodob committed Feb 19, 2015
1 parent 6f869f6 commit ac0b780
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pybossa/view/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@

blueprint = Blueprint('account', __name__)


mail_queue = Queue('super', connection=sentinel.master)
LINK_EXPIRATION = current_app.config.get('ACCOUNT_LINK_EXPIRATION', 3600)


def get_update_feed():
Expand Down Expand Up @@ -277,7 +275,8 @@ def confirm_account():
if key is None:
abort(403)
try:
userdict = signer.loads(key, max_age=LINK_EXPIRATION, salt='account-validation')
timeout = current_app.config.get('ACCOUNT_LINK_EXPIRATION', 3600)
userdict = signer.loads(key, max_age=timeout, salt='account-validation')
except BadData:
abort(403)
# First check if the user exists
Expand Down Expand Up @@ -600,7 +599,8 @@ def reset_password():
abort(403)
userdict = {}
try:
userdict = signer.loads(key, max_age=LINK_EXPIRATION, salt='password-reset')
timeout = current_app.config.get('ACCOUNT_LINK_EXPIRATION', 3600)
userdict = signer.loads(key, max_age=timeout, salt='password-reset')
except BadData:
abort(403)
username = userdict.get('user')
Expand Down

0 comments on commit ac0b780

Please sign in to comment.