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

Method delete_user

web/setup.py:372–395  ·  view source on GitHub ↗

Delete the user.

(username: str,
                    auth_source: AuthType = AuthType.internal,
                    auto_confirm: Annotated[Optional[bool],
                                            typer.Option(
                                                "--yes")] = False,
                    sqlite_path: Optional[str] = None,
                    )

Source from the content-addressed store, hash-verified

370 @app.command()
371 @update_sqlite_path
372 def delete_user(username: str,
373 auth_source: AuthType = AuthType.internal,
374 auto_confirm: Annotated[Optional[bool],
375 typer.Option(
376 "--yes")] = False,
377 sqlite_path: Optional[str] = None,
378 ):
379 """Delete the user. """
380
381 confirm_msg = "Are you sure you want to delete it?"
382
383 if auto_confirm or typer.confirm(confirm_msg):
384 app = create_app(config.APP_NAME + '-cli')
385 with app.test_request_context():
386 uid = ManageUsers.get_user(username=username,
387 auth_source=auth_source)
388 if not uid:
389 print(USER_NOT_FOUND_STR)
390 else:
391 status, msg = delete_user(uid)
392 if status:
393 print('User deleted successfully.')
394 else:
395 print(SOMETHING_WENT_WRONG + str(msg))
396
397 @app.command()
398 @update_sqlite_path

Callers

nothing calls this directly

Calls 4

create_appFunction · 0.90
delete_userFunction · 0.90
confirmMethod · 0.80
get_userMethod · 0.45

Tested by

no test coverage detected