scout/commands/update/panel.py
def panel(context, panel, version, update_date, update_version):
    """
    Update a panel in the database
    """
    adapter = context.obj['adapter']

    # Check that the panel exists
    panel_obj = adapter.gene_panel(panel, version=version)

    if not panel_obj:
        LOG.warning("Panel %s (version %s) could not be found" % (panel, version))
        context.abort()

    date_obj = None
    if update_date:
        try:
            date_obj = get_date(update_date)
        except Exception as err:
            LOG.warning(err)
            context.abort()

    update_panel(
        adapter,
        panel,
        panel_version=panel_obj['version'],
        new_version=update_version,
        new_date=date_obj
    )
def panel(context, panel, version, update_date, update_version):
    """
    Update a panel in the database
    """
    adapter = context.obj['adapter']

    # Check that the panel exists
    panel_obj = adapter.gene_panel(panel, version=version)

    if not panel_obj:
        LOG.warning("Panel %s (version %s) could not be found" % (panel, version))
        context.abort()

    date_obj = None
    if update_date:
        try:
            date_obj = get_date(update_date)
        except Exception as err:
            LOG.warning(err)
            context.abort()

    update_panel(
        adapter,
        panel,
        panel_version=panel_obj['version'],
        new_version=update_version,
        new_date=date_obj
    )
Update a panel in the database