mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-11-09 23:00:56 +00:00
fix: add try-except block for importing new_site
maintain compatibility across frappe versions. Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
This commit is contained in:
parent
d2450ef742
commit
3cf41a18f7
@ -2,7 +2,7 @@ import os
|
|||||||
import frappe
|
import frappe
|
||||||
import semantic_version
|
import semantic_version
|
||||||
|
|
||||||
from frappe.installer import _new_site, update_site_config
|
from frappe.installer import update_site_config
|
||||||
from constants import COMMON_SITE_CONFIG_FILE, RDS_DB, RDS_PRIVILEGES
|
from constants import COMMON_SITE_CONFIG_FILE, RDS_DB, RDS_PRIVILEGES
|
||||||
from utils import (
|
from utils import (
|
||||||
run_command,
|
run_command,
|
||||||
@ -11,6 +11,16 @@ from utils import (
|
|||||||
get_password,
|
get_password,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# try to import _new_site from frappe, which could possibly
|
||||||
|
# exist in either commands.py or installer.py, and so we need
|
||||||
|
# to maintain compatibility across all frappe versions.
|
||||||
|
try:
|
||||||
|
# <= version-{11,12}
|
||||||
|
from frappe.commands.site import _new_site
|
||||||
|
except ImportError:
|
||||||
|
# >= version-13 and develop
|
||||||
|
from frappe.installer import _new_site
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
config = get_config()
|
config = get_config()
|
||||||
|
Loading…
Reference in New Issue
Block a user