Exemple #1
0
def delete (ctx, client_uid):
    """Deletes a client"""
    client_services = ClientServices(ctx.obj["file_name"])

    clients_list = client_services.list_clients()

    client = [client for client in clients_list if client["uid"] == client_uid]

    if client:
        client = ClientModel(**client[0])
        client_services.delete_client(client)
        click.echo("Client deleted!")
    else:
        click.echo("Client not found!")       
Exemple #2
0
def delete(ctx, client_uid):
    """ Delete a client"""
    client_services = ClientServices(ctx.obj['clients_table'])

    clients_list = client_services.list_clients()

    client = [client for client in clients_list if client['uid'] == client_uid]

    if client:
        client = ClientModel(**client[0])
        client_services.delete_client(client)
        click.echo('Client deleted')
    else:
        click.echo('Client not fount')