Fixed an issue where the create_app() function was called twice if an SQLite database file was not present.

Remove the exec call to run the 'setup.py' instead call the setup database function directly.
This commit is contained in:
Akshay Joshi
2022-07-01 14:50:12 +05:30
parent 9c745db413
commit bf7de8e7a5
2 changed files with 8 additions and 13 deletions
+3 -4
View File
@@ -86,13 +86,11 @@ def load_servers(args):
load_database_servers(args.load_servers, None, load_user, True)
def setup_db():
def setup_db(app):
"""Setup the configuration database."""
create_app_data_directory(config)
app = create_app()
print("pgAdmin 4 - Application Initialisation")
print("======================================\n")
@@ -193,4 +191,5 @@ if __name__ == '__main__':
except Exception as e:
print(str(e))
else:
setup_db()
app = create_app()
setup_db(app)