Fix an error on exit caused by the cookie path patch.

This commit is contained in:
Khushboo Vashi 2018-03-20 13:55:06 +00:00 committed by Dave Page
parent 3bd9bdad61
commit 4942c938ac
2 changed files with 10 additions and 3 deletions

View File

@ -148,7 +148,6 @@ if __name__ == '__main__':
# Reference:
# https://github.com/pallets/werkzeug/issues/220#issuecomment-11176538
try:
app.run(
host=config.DEFAULT_SERVER,
port=server_port,
@ -158,8 +157,7 @@ if __name__ == '__main__':
),
threaded=config.THREADED_MODE
)
from pgadmin.utils.paths import get_cookie_path
config.COOKIE_DEFAULT_PATH = get_cookie_path()
except IOError:
app.logger.error("Error starting the app server: %s", sys.exc_info())

View File

@ -541,6 +541,15 @@ def create_app(app_name=None):
app.logger.info('Registering blueprint module: %s' % module)
app.register_blueprint(module)
#########################################################################
# Set cookie path
#########################################################################
@app.before_first_request
def before_first_request():
from pgadmin.utils.paths import get_cookie_path
config.COOKIE_DEFAULT_PATH = get_cookie_path()
##########################################################################
# Handle the desktop login
##########################################################################