Skip to content

Commit

Permalink
fix(jans-cli-tui): TUI fixes (#8259)
Browse files Browse the repository at this point in the history
* fix(jans-cli-tui): user IMAP data

Signed-off-by: Mustafa Baser <mbaser@mail.com>

* fix(jans-cli-tui): missing fromisoformat in py 3.6

Signed-off-by: Mustafa Baser <mbaser@mail.com>

* fix(jans-cli-tui): return if agama widget is empty when pressing c

Signed-off-by: Mustafa Baser <mbaser@mail.com>

---------

Signed-off-by: Mustafa Baser <mbaser@mail.com>
  • Loading branch information
devrimyatar committed Apr 8, 2024
1 parent 85ef7ae commit 81d15e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions jans-cli-tui/cli_tui/plugins/010_auth_server/agama.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def on_page_enter(self) -> None:

def display_config(self, event):

if not self.working_container.all_data:
return

project_data = self.working_container.all_data[self.working_container.selectes]
project_name = project_data['details']['projectMetadata']['projectName']
fdata = SimpleNamespace()
Expand Down
4 changes: 2 additions & 2 deletions jans-cli-tui/cli_tui/plugins/010_auth_server/ssa.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from cli import config_cli
from utils.multi_lang import _
from utils.utils import DialogUtils
from utils.utils import DialogUtils, fromisoformat
from utils.static import cli_style, common_strings
from wui_components.jans_vetrical_nav import JansVerticalNav
from wui_components.jans_cli_dialog import JansGDialog
Expand Down Expand Up @@ -121,7 +121,7 @@ def save_ssa(self, dialog):
new_data['expiration'] = int(datetime.now().timestamp()) + 1576800000
else:
if self.expire_widget.value:
new_data['expiration'] = int(datetime.fromisoformat(self.expire_widget.value).timestamp())
new_data['expiration'] = int(fromisoformat(self.expire_widget.value).timestamp())

new_data['software_roles'] = new_data['software_roles'].splitlines()

Expand Down
6 changes: 4 additions & 2 deletions jans-cli-tui/cli_tui/plugins/070_users/edit_user_dialog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import Optional, Sequence, Callable
import asyncio
import json

from typing import Optional, Sequence, Callable
from functools import partial

from prompt_toolkit import HTML
Expand Down Expand Up @@ -301,7 +303,7 @@ def save_user(self) -> None:
multi_valued = False
key_prop = self.get_claim_properties(key_)

if key_prop.get('dataType') == 'json':
if key_prop.get('dataType') == 'json' and raw_data[key_]:
try:
json.loads(raw_data[key_])
except Exception as e:
Expand Down

0 comments on commit 81d15e6

Please sign in to comment.