Commit 4000b52c authored by Philipp Hörist's avatar Philipp Hörist

Dataform: Validate field on creation

Dataforms can provide default values for fields
parent 63b32126
......@@ -257,7 +257,9 @@ class Field:
form_grid.attach_next_to(self._warning_box,
self._widget,
Gtk.PositionType.RIGHT, 1, 1)
self._set_warning(False, '')
is_valid, error = self._field.is_valid()
self._set_warning(is_valid, error)
def _set_warning(self, is_valid, error):
if not self._field.required and not is_valid and not error:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment