Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom field slug with '/' might break UI #1962

Closed
sklemer1 opened this issue Jun 27, 2022 · 4 comments · Fixed by #2136
Closed

custom field slug with '/' might break UI #1962

sklemer1 opened this issue Jun 27, 2022 · 4 comments · Fixed by #2136
Assignees
Labels
type: bug Something isn't working as expected
Milestone

Comments

@sklemer1
Copy link
Contributor

sklemer1 commented Jun 27, 2022

Environment

  • Python version: 3.7.3
  • Nautobot version: 1.3.2

Steps to Reproduce

  1. Create a new custom field named Devices / Virtual Machines
  2. Go to https://mynautobot/extras/custom-fields/
  3. You get
<class 'django.urls.exceptions.NoReverseMatch'>

Reverse for 'customfield' with arguments '('Devices / Virtual Machines',)' not found. 1 pattern(s) tried: ['extras/custom\\-fields/(?P<name>[^/]+)/\\Z']

Python version: 3.7.3
Nautobot version: 1.3.2

Expected Behavior

Impossibility to add such a slug and/or correct URL reversal.

Observed Behavior

Python Exception and need to remove the broken cf via nbshell.

TODO

  • Add a slug field and use it in URL patterns
@glennmatthews
Copy link
Contributor

Thanks for the report! #824 is the tracking issue for changing the CustomField model to actually make this field a proper slug field, which would fix this issue and several related symptoms.

@glennmatthews glennmatthews added the type: bug Something isn't working as expected label Jun 27, 2022
@HanlinMiao HanlinMiao changed the title custom fiedl slug with '/' might break UI custom field slug with '/' might break UI Jul 8, 2022
@bryanculver
Copy link
Member

As a bug fix, we will add a slug field and use it in URL patterns.

@bryanculver bryanculver added this to the 1.3.10 milestone Jul 26, 2022
@glennmatthews glennmatthews self-assigned this Aug 1, 2022
@glennmatthews glennmatthews modified the milestones: v1.3.10, v1.4.0 Aug 2, 2022
@glennmatthews
Copy link
Contributor

Fixing this the "right" way will require adding a versioned REST API serializer, I think - so moving this to 1.4 milestone.

@glennmatthews
Copy link
Contributor

Implemented for 1.4 by #2136.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants