]> git.ipfire.org Git - people/ms/bricklayer.git/commitdiff
tui: Fix return values when the callback wasn't callable
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 May 2021 20:10:21 +0000 (20:10 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 May 2021 20:10:21 +0000 (20:10 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/tui.py

index 19a646e2ceacfc3ec8f2f994c4254569f44792c4..4988b691ff7bc12445a29f8861a5db9d082bc295 100644 (file)
@@ -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