Skip to content

Make slug fields optional for all models #8113

@jeremystretch

Description

@jeremystretch

NetBox version

v3.1.1

Feature type

Change to existing functionality

Proposed functionality

For all 22 models which currently have a required slug field, make the field optional and remove the uniqueness requirement. This will make the slug field no longer required in UI forms and REST API serializers.

Use case

Slugs are no longer used as unique identifiers in NetBox URLs, and no longer serve any native function. #8036 proposed removing slug fields entirely, however some users have expressed opposition to this idea. As an alternative, making slugs optional will preserve their utility for those users while alleviating the undue burden they place on users who do not.

Users who wish to still enforce slugs as required fields can employ simple custom validation rules to do so.

Database changes

A migration will be introduced within each app altering all models.SlugField instances to set blank=True.

External dependencies

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending closureRequires immediate attention to avoid being closed for inactivitystatus: under reviewFurther discussion is needed to determine this issue's scope and/or implementationtype: featureIntroduction of new functionality to the application

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions