WSL Validates the username with the endpoint.

This commit is contained in:
Carlos Nihelton 2022-05-09 15:41:13 -03:00
parent 9cb27da947
commit 0dba0722ab
No known key found for this signature in database
GPG Key ID: 6FE346D245197E9A
2 changed files with 3 additions and 15 deletions

View File

@ -15,16 +15,14 @@
import logging import logging
from subiquity.client.controller import SubiquityTuiController from subiquity.client.controllers import IdentityController
from subiquity.common.types import IdentityData from subiquity.common.types import IdentityData
from system_setup.ui.views import WSLIdentityView from system_setup.ui.views import WSLIdentityView
log = logging.getLogger('system_setup.client.controllers.identity') log = logging.getLogger('system_setup.client.controllers.identity')
class WSLIdentityController(SubiquityTuiController): class WSLIdentityController(IdentityController):
endpoint_name = 'identity'
async def make_ui(self): async def make_ui(self):
data = await self.endpoint.GET() data = await self.endpoint.GET()
@ -38,13 +36,3 @@ class WSLIdentityController(SubiquityTuiController):
username=self.answers['username'], username=self.answers['username'],
crypted_password=self.answers['password']) crypted_password=self.answers['password'])
self.done(identity) self.done(identity)
def cancel(self):
self.app.prev_screen()
def done(self, identity_data):
log.debug(
"IdentityController.done next_screen user_spec=%s",
identity_data)
self.app.identity = identity_data
self.app.next_screen(self.endpoint.POST(identity_data))

View File

@ -69,7 +69,7 @@ class WSLIdentityView(BaseView):
# This is the different form model with IdentityView # This is the different form model with IdentityView
# which prevents us from inheriting it # which prevents us from inheriting it
self.form = WSLIdentityForm([], initial) self.form = WSLIdentityForm(controller, initial)
connect_signal(self.form, 'submit', self.done) connect_signal(self.form, 'submit', self.done)
setup_password_validation(self.form, _("passwords")) setup_password_validation(self.form, _("passwords"))