Merge pull request #1104 from CarlosNihelton/ft-prefill-p1

LocaleController.start() check model language
This commit is contained in:
Dan Bungert 2021-10-28 11:12:18 -06:00 committed by GitHub
commit f21986be88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -36,8 +36,13 @@ class LocaleController(SubiquityController):
os.environ["LANG"] = data
def start(self):
self.model.selected_language = os.environ.get("LANG") \
# Language model may have been initialized before start() is called.
# But for autoinstall (not interactive), someone else
# initializing to a different value would be unexpected behavior.
if not self.interactive() or (self.model.selected_language is None):
self.model.selected_language = os.environ.get("LANG") \
or self.autoinstall_default
self.app.aio_loop.create_task(self.configured())
self.app.hub.subscribe(
(InstallerChannels.CONFIGURED, 'source'), self._set_source)