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

Closed
opened 2025-12-29 20:49:34 +01:00 by adam · 1 comment
Owner

Originally created by @maddin8 on GitHub (Apr 1, 2024).

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.

Originally created by @maddin8 on GitHub (Apr 1, 2024). ### 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.
adam closed this issue 2025-12-29 20:49:34 +01:00
Author
Owner

@maddin8 commented on GitHub (Apr 2, 2024):

I just found out that the "Default" value is called "outline-dark" by looking into the "button_class" column of the "extras_customlink" table of another Netbox instance (I also found the evidence in the Code after searching for the value "outline-dark" in Github).

I'm not sure anymore if this is a bug or just needs improvement in documentation as I didn't find this being mentioned in the Netbox UI or the Documentation (Something like "Default is "outline-dark"" in either of these places would be helpful.

New to "contributing" to Github, so I think I'll close this and instead suggest an addition to documentation.

@maddin8 commented on GitHub (Apr 2, 2024): I just found out that the "Default" value is called "outline-dark" by looking into the "button_class" column of the "extras_customlink" table of another Netbox instance (I also found the evidence in the Code after searching for the value "outline-dark" in Github). I'm not sure anymore if this is a bug or just needs improvement in documentation as I didn't find this being mentioned in the Netbox UI or the Documentation (Something like "Default is "outline-dark"" in either of these places would be helpful. New to "contributing" to Github, so I think I'll close this and instead suggest an addition to documentation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9419