diff --git a/ceo/tui/CeoFrame.py b/ceo/tui/CeoFrame.py index 797c25c..cd4086c 100644 --- a/ceo/tui/CeoFrame.py +++ b/ceo/tui/CeoFrame.py @@ -126,7 +126,7 @@ class CeoFrame(Frame): self.add_layout(layout) self._status_label = Label('') layout.add_widget(self._status_label) - + def flash_message(self, msg: str, force_update: bool = False): self._status_label.text = msg if force_update: diff --git a/ceo/tui/members/GetUserView.py b/ceo/tui/members/GetUserView.py index 5884994..cabbfe5 100644 --- a/ceo/tui/members/GetUserView.py +++ b/ceo/tui/members/GetUserView.py @@ -3,6 +3,7 @@ from asciimatics.widgets import Layout, Text from ...utils import http_get from ..CeoFrame import CeoFrame + class GetUserView(CeoFrame): def __init__(self, screen, width, height, model): super().__init__( @@ -13,7 +14,7 @@ class GetUserView(CeoFrame): self.add_layout(layout) self._username = Text("Username:", "uid") layout.add_widget(self._username) - + self.add_flash_message_layout() self.add_buttons( back_btn=True, diff --git a/ceo/tui/members/ResetPasswordView.py b/ceo/tui/members/ResetPasswordView.py index c06d520..b922799 100644 --- a/ceo/tui/members/ResetPasswordView.py +++ b/ceo/tui/members/ResetPasswordView.py @@ -15,16 +15,16 @@ class ResetPasswordView(CeoFrame): layout.add_widget(Label('Enter the username of the user whose password will be reset:')) self._username = Text(None, "uid") layout.add_widget(self._username) - + self.add_buttons( back_btn=True, next_scene='Confirm', on_next=self._next) self.fix() - + def _next(self): uid = self._username.value self._model.viewdata['ResetPassword']['uid'] = uid - self._model.confirm_lines= [ + self._model.confirm_lines = [ f"Are you sure you want to reset {uid}'s password?", ] self._model.deferred_req = defer(http_post, f'/api/members/{uid}/pwreset')