scout/commands/load/institute.py
def institute(ctx, internal_id, display_name, sanger_recipients):
    """
    Create a new institute and add it to the database

    """
    adapter = ctx.obj['adapter']

    if not internal_id:
        logger.warning("A institute has to have an internal id")
        ctx.abort()

    if not display_name:
        display_name = internal_id

    if sanger_recipients:
        sanger_recipients = list(sanger_recipients)

    try:
        load_institute(
            adapter=adapter,
            internal_id=internal_id,
            display_name=display_name,
            sanger_recipients=sanger_recipients
        )
    except Exception as e:
        logger.warning(e)
        ctx.abort()
def institute(ctx, internal_id, display_name, sanger_recipients):
    adapter = ctx.obj['adapter']

    if not internal_id:
        logger.warning("A institute has to have an internal id")
        ctx.abort()

    if not display_name:
        display_name = internal_id

    if sanger_recipients:
        sanger_recipients = list(sanger_recipients)

    try:
        load_institute(
            adapter=adapter,
            internal_id=internal_id,
            display_name=display_name,
            sanger_recipients=sanger_recipients
        )
    except Exception as e:
        logger.warning(e)
        ctx.abort()
def institute ( ctx , internal_id , display_name , sanger_recipients ) : adapter = ctx . obj [ 'adapter' ] if not internal_id : logger . warning ( "A institute has to have an internal id" ) ctx . abort ( ) if not display_name : display_name = internal_id if sanger_recipients : sanger_recipients = list ( sanger_recipients ) try : load_institute ( adapter = adapter , internal_id = internal_id , display_name = display_name , sanger_recipients = sanger_recipients ) except Exception as e : logger . warning ( e ) ctx . abort ( )
Create a new institute and add it to the database
Create a new institute and add it to the database