mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-23 01:06:31 -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,6 +76,8 @@ class DriverRegistry(ABCMeta):
|
||||
|
||||
@classmethod
|
||||
def load_drivers(cls):
|
||||
# Initialize the registry only if it has not yet been initialized
|
||||
if DriverRegistry.registry is None:
|
||||
DriverRegistry.registry = dict()
|
||||
|
||||
from importlib import import_module
|
||||
|
Loading…
Reference in New Issue
Block a user