feat: 通过django settings延迟获取BASE_PROJECT_CODE

This commit is contained in:
caoqianming 2025-04-23 12:42:50 +08:00
parent f4bb1d952f
commit ee7908f6bc
1 changed files with 2 additions and 1 deletions

View File

@ -5,7 +5,7 @@ from apps.inm.models import MIOItem
from apps.qm.models import FtestWork
from django.utils import timezone
from datetime import datetime
from server.conf import BASE_PROJECT_CODE
from django.conf import settings
import json
from apps.utils.tools import MyJSONEncoder
import decimal
@ -17,6 +17,7 @@ def get_alldata_with_batch_and_store(batch: str):
获取某个批次的整体生产数据并保存
"""
need_update = False
BASE_PROJECT_CODE = getattr(settings, "BASE_PROJECT_CODE", None)
if BASE_PROJECT_CODE == "gzerp":
need_update = True
last_time, data = get_alldata_with_batch(batch)