From: Michael Tremer Date: Mon, 10 May 2021 20:10:21 +0000 (+0000) Subject: tui: Fix return values when the callback wasn't callable X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10b5fe072367ffc964e36a7a21ec809bdfd7f239;p=people%2Fms%2Fbricklayer.git tui: Fix return values when the callback wasn't callable Signed-off-by: Michael Tremer --- diff --git a/src/python/tui.py b/src/python/tui.py index 19a646e..4988b69 100644 --- a/src/python/tui.py +++ b/src/python/tui.py @@ -238,7 +238,11 @@ class ButtonsWindow(Window): return callback() # Otherwise call the default action - return self.default_action() + elif callback is None: + return self.default_action() + + # Or just return the value + return callback # If any of the callbacks raise TryAgain, we go back and let the user # edit the form again