Skip to content

CSV Import of Custom Links fails when button_class is "default" #15596

@maddin8

Description

@maddin8

Deployment Type

Self-hosted

NetBox Version

v3.7.4

Python Version

3.11

Steps to Reproduce

  1. Go to Custom links
  2. Prepare some CSV file with dummy values for a Custom Link to import, see below for example.
  3. Attempt the Import of the CSV file or use Direct import via Comma-separated data.

Sample data used to reproduce the observed behavior:

name,content_types,enabled,group_name,button_class,new_window,link_text,link_url,weight
Test,"dcim.device,virtualization.virtualmachine",TRUE,Testgroup,default,TRUE,Open Link in new Window,https://{{ object.name }}:443/,100

Also tried with:

name,content_types,enabled,group_name,button_class,new_window,link_text,link_url,weight
Test,"dcim.device,virtualization.virtualmachine",TRUE,Testgroup,Default,TRUE,Open Link in new Window,https://{{ object.name }}:443/,100

Expected Behavior

The new Custom Link should be created with a "Button Class" value of "Default", just as it works when creating a new Custom Field manually via the GUI and leaving "Default" as the "Button Class" as displayed.

Observed Behavior

Error "Record 1 button_class: Select a valid choice. Default is not one of the available choices." is displayed in the GUI and the Custom Link is not created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions