Fixed ModuleNotFoundError when running setup.py from outside of the root. Fixes #6408

This commit is contained in:
Cyril Jouve 2021-04-27 12:54:57 +05:30 committed by Akshay Joshi
parent 7bab200e4d
commit 718ac02806
2 changed files with 5 additions and 3 deletions

View File

@ -21,3 +21,4 @@ Bug fixes
| `Issue #6341 <https://redmine.postgresql.org/issues/6341>`_ - Fixed an issue where CSV download quotes the numeric columns.
| `Issue #6377 <https://redmine.postgresql.org/issues/6377>`_ - Fixed an issue where schema diff does not create DROP DEFAULT statement for columns.
| `Issue #6385 <https://redmine.postgresql.org/issues/6385>`_ - Ensure that Backup and Restore should work on shared servers.
| `Issue #6408 <https://redmine.postgresql.org/issues/6408>`_ - Fixed ModuleNotFoundError when running setup.py from outside of the root.

View File

@ -10,9 +10,6 @@
"""Perform the initial setup of the application, by creating the auth
and settings database."""
from pgadmin.model import db, User, Version, ServerGroup, Server, \
SCHEMA_VERSION as CURRENT_SCHEMA_VERSION
from pgadmin import create_app
import argparse
import json
import os
@ -33,6 +30,10 @@ root = os.path.dirname(os.path.realpath(__file__))
if sys.path[0] != root:
sys.path.insert(0, root)
from pgadmin.model import db, User, Version, ServerGroup, Server, \
SCHEMA_VERSION as CURRENT_SCHEMA_VERSION
from pgadmin import create_app
def add_value(attr_dict, key, value):
"""Add a value to the attribute dict if non-empty.