questions prompt: include normalize in the try/except to re-ask question if not properly formated

This commit is contained in:
Alexandre Aubin 2021-09-23 02:58:13 +02:00
parent 78ad3b5da3
commit d023333fa4

View file

@ -520,12 +520,9 @@ class Question(object):
):
self.value = class_default if self.default is None else self.default
# Normalization
# This is done to enforce a certain formating like for boolean
self.value = self.normalize(self.value, self)
# Prevalidation
try:
# Normalize and validate
self.value = self.normalize(self.value, self)
self._prevalidate()
except YunohostValidationError as e:
# If in interactive cli, re-ask the current question