fix(webui): keep registration entry flow setting after restart#64
Open
ilh-github wants to merge 2 commits intodou-jiang:mainfrom
Open
fix(webui): keep registration entry flow setting after restart#64ilh-github wants to merge 2 commits intodou-jiang:mainfrom
ilh-github wants to merge 2 commits intodou-jiang:mainfrom
Conversation
360f262 to
d49fff2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
main()会先调用update_settings(),再执行数据库初始化。update_settings()会基于默认内存配置构建设置,导致registration_entry_flow等已持久化字段被回退为默认值(native)。修复
webui.py::main()中先执行与setup_application()一致的初始化前置步骤:_load_dotenv()data/logs目录APP_DATA_DIR/APP_LOGS_DIRinitialize_database()update_settings(...)的 CLI/环境变量覆盖。结果
registration_entry_flow等数据库配置在重启后保持不变。验证
registration.entry_flow=abcard,按命令行启动流程后读到native。abcard。PYTHONPATH=. ./.venv/bin/pytest -q tests/test_settings_registration_auto_fields.py