Instead of using isinstance(self.widget, SubFormWidget) in
BoundFormField.is_in_error, we now implement a BoundSubFormField
class that inherits from BoundFormField. It is meant to be instantianted
for subforms fields only.
This class overrides is_in_error() to perform the additional checks in
the forms' sub-fields.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
When the validation of a field fails in a form, we disable the Done
button. With child forms, however, it did not work because they have
their own set of hidden buttons ; that are not the ones the users
interacts with.
This patch makes parent forms recurse on the child forms when checking
if any field is in error. Also, when a child form undertakes validation,
it now propagates to the parent, so that the done button can be
immediately enabled/disabled.
Having a validation error in a child form that is not currently enabled
should not prevent the user from moving forward, so we disable recursion
for child forms that are disabled.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
lang-packs post-install hook executes locale-gen.
For certain languages a matrix of locales is generated.
Re-running locale-gen regenerates not only the locale we wanted,
but the whole matrix, causing further delays.
We can save up to 40s (tested on my laptop) by skipping locale-gen if
apt succeeded.
Still useful to run it unconditionally i dry-run since apt won't execute
any post-install hook.
If the probert probe triggers a udev event, we can loop forever.
Fixed by not restarting an active probe, which can lose information if
it appears mid-probe but that's better than an infinite loop.
cancel_restart is a mode for SingleInstanceTask that changes the
behavior when starting the task - if the task is already running, do not
cancel it to start another.
python3-aiohttp has been fixed and released in focal-updates.
New Subiquity builds should not be affected by LP: #1969393 anymore.
This reverts commit 413cc87337.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Test class inherits form IsolatedAsyncioTestCase to enable coroutines.
Event loop policy is reset on module teardown to avoid conflicting with
next tests.
Initializes it with just 'root' by default.
Server variants may find appropriate ways to initialize it.
Reading the passwd database of the target is not a reliable thing to do.
Need to find a stronger way before placing that in the main server.