mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-26 18:50:28 -06:00
Do not reset the driver registry when the 'load_driver' method of
DriverRegistry is executed second time. Also, initialize the driver before registering different blueprints, which uses those driver inside them. Thanks Khushboo for reporting the issue.
This commit is contained in:
parent
52aa32a4d2
commit
26e9ceaf48
@ -201,6 +201,9 @@ def create_app(app_name=config.APP_NAME):
|
||||
from setup import do_upgrade
|
||||
do_upgrade(app, user_datastore, security, version)
|
||||
|
||||
# Load all available serve drivers
|
||||
driver.init_app(app)
|
||||
|
||||
##########################################################################
|
||||
# Load plugin modules
|
||||
##########################################################################
|
||||
@ -252,9 +255,6 @@ def create_app(app_name=config.APP_NAME):
|
||||
'current_blueprint': current_blueprint
|
||||
}
|
||||
|
||||
# Load all available serve drivers
|
||||
driver.init_app(app)
|
||||
|
||||
##########################################################################
|
||||
# All done!
|
||||
##########################################################################
|
||||
|
@ -46,7 +46,7 @@ class DriverRegistry(ABCMeta):
|
||||
- Use this function from init_app(...) to load all available drivers in
|
||||
the registry.
|
||||
"""
|
||||
registry = dict()
|
||||
registry = None
|
||||
drivers = dict()
|
||||
|
||||
def __init__(cls, name, bases, d):
|
||||
@ -76,7 +76,9 @@ class DriverRegistry(ABCMeta):
|
||||
|
||||
@classmethod
|
||||
def load_drivers(cls):
|
||||
DriverRegistry.registry = dict()
|
||||
# Initialize the registry only if it has not yet been initialized
|
||||
if DriverRegistry.registry is None:
|
||||
DriverRegistry.registry = dict()
|
||||
|
||||
from importlib import import_module
|
||||
from werkzeug.utils import find_modules
|
||||
|
Loading…
Reference in New Issue
Block a user