Skip to content

Commit

Permalink
fix: jans-cli Error on deleting without verification of deletion (ref:
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelwahabAdam committed Nov 29, 2022
1 parent 449d954 commit f06753f
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion jans-cli-tui/cli_tui/plugins/020_fido/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,25 @@ def add_request_party(dialog: Dialog) -> None:
def delete_requested_party(self, **kwargs: Any) -> None:
"""This method for deleting the requested party
"""
self.requested_parties_container.remove_item(kwargs['selected'])

dialog = self.app.get_confirm_dialog(_("Are you sure want to delete requested patry:")+"\n {} ?".format(kwargs['selected'][1]))

async def coroutine():
focused_before = self.app.layout.current_window
result = await self.app.show_dialog_as_float(dialog)
try:
self.app.layout.focus(focused_before)
except:
self.app.stop_progressing()
self.app.layout.focus(self.app.center_frame)

if result.lower() == 'yes':
self.requested_parties_container.remove_item(kwargs['selected'])
self.app.stop_progressing()

return result

asyncio.ensure_future(coroutine())

def create_widgets(self):
self.schema = self.app.cli_object.get_schema_from_reference('Fido2', '#/components/schemas/AppConfiguration')
Expand Down

0 comments on commit f06753f

Please sign in to comment.