mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 17:08:41 -06:00
Fixes #12112: Do not link data source URL for local paths
This commit is contained in:
parent
cdad50e051
commit
730eb2e83b
@ -71,6 +71,7 @@ Two new webhook trigger events have been introduced: `job_start` and `job_end`.
|
|||||||
### Bug Fixes (From Beta1)
|
### Bug Fixes (From Beta1)
|
||||||
|
|
||||||
* [#12109](https://github.com/netbox-community/netbox/issues/12109) - Fix migration error when replicating more than 100 job results
|
* [#12109](https://github.com/netbox-community/netbox/issues/12109) - Fix migration error when replicating more than 100 job results
|
||||||
|
* [#12112](https://github.com/netbox-community/netbox/issues/12112) - Do not link data source URL for local paths
|
||||||
|
|
||||||
### Other Changes
|
### Other Changes
|
||||||
|
|
||||||
|
@ -95,6 +95,10 @@ class DataSource(JobsMixin, PrimaryModel):
|
|||||||
def url_scheme(self):
|
def url_scheme(self):
|
||||||
return urlparse(self.source_url).scheme.lower()
|
return urlparse(self.source_url).scheme.lower()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_local(self):
|
||||||
|
return self.type == DataSourceTypeChoices.LOCAL
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ready_for_sync(self):
|
def ready_for_sync(self):
|
||||||
return self.enabled and self.status not in (
|
return self.enabled and self.status not in (
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
<table class="table table-hover attr-table">
|
<table class="table table-hover attr-table">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Source</th>
|
<th scope="row">Source</th>
|
||||||
<td><a href="{{ object.source.get_absolute_url }}">{{ object.source }}</a></td>
|
<td>{{ object.source|linkify }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Path</th>
|
<th scope="row">Path</th>
|
||||||
|
@ -57,7 +57,11 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="row">URL</th>
|
<th scope="row">URL</th>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ object.source_url }}">{{ object.source_url }}</a>
|
{% if not object.is_local %}
|
||||||
|
<a href="{{ object.source_url }}">{{ object.source_url }}</a>
|
||||||
|
{% else %}
|
||||||
|
{{ object.source_url }}
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user