Compare commits

..

10 Commits

Author SHA1 Message Date
root
6d1f5eaeb8 Merge remote-tracking branch 'origin', tag 'v2.6.8' into multilink-circuit 2019-12-12 14:19:15 +01:00
Jeremy Stretch
3b03d68ac7 Merge pull request #3751 from hSaria/3749-attribute-error
Fixes 3749 attribute error
2019-12-11 08:50:09 -05:00
hSaria
b57d64c72d Changelog for #3751 2019-12-11 07:24:44 +00:00
hSaria
3b76e0203a Fixes 3749 attribute error 2019-12-11 07:03:39 +00:00
Jeremy Stretch
3c36bec298 Post-release version bump 2019-12-10 10:50:46 -05:00
root
cf4dcd3dd7 Merge remote-tracking branch 'origin/master' into multilink-circuit 2019-09-23 12:33:58 +02:00
root
b713fdbadc Merge remote-tracking branch 'origin/master' into multilink-circuit 2019-09-05 20:38:32 +02:00
root
da13444d70 Merge remote-tracking branch 'origin/master' into multilink-circuit 2019-09-05 20:35:11 +02:00
Sander Steffann
293937a1a7 Restore functionality of showing Circuit when no Interface connected 2019-06-17 21:29:43 +02:00
Sander Steffann
1661af480f Second attempt at a patch for #3193 2019-06-17 21:09:08 +02:00
5 changed files with 44 additions and 5 deletions

View File

@@ -1,3 +1,9 @@
# v2.6.9 (FUTURE)
## Bug Fixes
* [#3749](https://github.com/netbox-community/netbox/issues/3749) - Fix exception on password change page for local users
# v2.6.8 (2019-12-10)
## Enhancements

View File

@@ -0,0 +1,19 @@
# Generated by Django 2.2.2 on 2019-06-17 19:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('dcim', '0069_deprecate_nullablecharfield'),
]
operations = [
migrations.AlterField(
model_name='interface',
name='_connected_circuittermination',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='circuits.CircuitTermination'),
),
]

View File

@@ -2178,7 +2178,7 @@ class Interface(CableTermination, ComponentModel):
blank=True,
null=True
)
_connected_circuittermination = models.OneToOneField(
_connected_circuittermination = models.ForeignKey(
to='circuits.CircuitTermination',
on_delete=models.SET_NULL,
related_name='+',
@@ -2971,8 +2971,10 @@ class Cable(ChangeLoggedModel):
Traverse both ends of a cable path and return its connected endpoints. Note that one or both endpoints may be
None.
"""
a_path = self.termination_b.trace()
b_path = self.termination_a.trace()
from circuits.models import CircuitTermination
a_path = self.termination_b.trace(follow_circuits=True)
b_path = self.termination_a.trace(follow_circuits=True)
# Determine overall path status (connected or planned)
if self.status == CONNECTION_STATUS_PLANNED:
@@ -2987,6 +2989,18 @@ class Cable(ChangeLoggedModel):
a_endpoint = a_path[-1][2]
b_endpoint = b_path[-1][2]
# If there is nothing on the other end show the first circuit
if not a_endpoint:
for segment in a_path:
if isinstance(segment[2], (Interface, CircuitTermination)):
a_endpoint = segment[2]
break
if not b_endpoint:
for segment in b_path:
if isinstance(segment[2], (Interface, CircuitTermination)):
b_endpoint = segment[2]
break
return a_endpoint, b_endpoint, path_status

View File

@@ -12,7 +12,7 @@ from django.core.exceptions import ImproperlyConfigured
# Environment setup
#
VERSION = '2.6.8'
VERSION = '2.6.9-dev'
# Hostname
HOSTNAME = platform.node()

View File

@@ -96,7 +96,7 @@ class ChangePasswordView(LoginRequiredMixin, View):
def get(self, request):
# LDAP users cannot change their password here
if getattr(request.user, 'ldap_username'):
if getattr(request.user, 'ldap_username', None):
messages.warning(request, "LDAP-authenticated user credentials cannot be changed within NetBox.")
return redirect('user:profile')