Moves model.add_user call to the right place

After the conditional
This commit is contained in:
Carlos Nihelton 2022-05-12 11:59:45 -03:00
parent f576c6fc85
commit aea54f961e
No known key found for this signature in database
GPG Key ID: 6FE346D245197E9A
1 changed files with 1 additions and 1 deletions

View File

@ -145,12 +145,12 @@ class IdentityController(SubiquityController):
return data
async def POST(self, data: IdentityData):
self.model.add_user(data)
validated = await self.validate_username_GET(data.username)
if validated != UsernameValidation.OK:
raise ValueError("Username <{}> is invalid and should not be"
" submitted.".format(data.username), validated)
self.model.add_user(data)
await self.configured()
async def validate_username_GET(self, username: str) -> UsernameValidation: