Closed MeganerdDev closed 1 week ago
I was able to mitigate this over the ORM for now
from nautobot.extras.models import GitRepository
GitRepository.objects.create(
name="test",
slug="test",
remote_url="https://local-dns-example/golden-config-backup.git",
branch="main"
)
Also unrelated to the URL Validator for local DNS names, but local pathfiles might also be considered during any refactoring change that is done to this entry? I had a separate case where I worked around this by creating the object over ORM
Nautobot has a custom nautobot.core.models.validators.EnhancedURLValidator
that supports hostnames, it looks like it might just be as simple as fixing the GitRepository
definition to use that instead of Django's default URLValidator
.
Similarly the form itself needs to use nautobot.core.forms.fields.LaxURLField
instead of Django's forms.URLField
.
Environment
Steps to Reproduce
extras/git-repositories
in the Nautobot UIAdd
button to begin creating a new GIT Repository objectRemote URL
charfield entry provide a local DNS name eg:https://local-dns-example/golden-config-backup.git
Update & Sync
buttonExpected Behavior
Object created and syncs as normal operation
Observed Behavior
URL validator throws an error preventing creation of the object![image](https://github.com/nautobot/nautobot/assets/114895043/fe48edd2-e6d4-4afb-897a-2f5af08d6408)
Additional Details
I wasn't sure if this would be a feature request or a bug report. I ended up with bug report.
URLValidator is upstream and provided by Django
from django.core.validators import URLValidator
URLValidator in Django