MCPcopy Index your code
hub / github.com/pgadmin-org/pgadmin4 / display_user

Method display_user

web/setup.py:593–614  ·  view source on GitHub ↗
(data, _console, _json)

Source from the content-addressed store, hash-verified

591 return usr.id
592
593 def display_user(data, _console, _json):
594 if _console:
595 if _json:
596 json_formatted_str = jsonlib.dumps(data, indent=0)
597 console.print(json_formatted_str)
598 else:
599 if isinstance(data, dict):
600 data = [data]
601 for _data in data:
602 table = Table(title="User Details", box=box.ASCII)
603 table.add_column("Field", style="green")
604 table.add_column("Value", style="green")
605
606 if 'username' in _data:
607 table.add_row("Username", _data['username'])
608 if 'email' in _data:
609 table.add_row("Email", _data['email'])
610 table.add_row("auth_source", _data['auth_source'])
611 table.add_row("role", _data['role'])
612 table.add_row("active",
613 'True' if _data['active'] else 'False')
614 console.print(table)
615
616
617class ManagePreferences:

Callers 3

update_userMethod · 0.80
get_users_from_dbMethod · 0.80
update_external_userMethod · 0.80

Calls 1

TableFunction · 0.50

Tested by

no test coverage detected