Skip to content

Commit

Permalink
Merge pull request #1154 from digitalocean/develop
Browse files Browse the repository at this point in the history
Release v2.0.1
  • Loading branch information
jeremystretch authored May 10, 2017
2 parents b1bcaa3 + b89bd24 commit f731900
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions netbox/dcim/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ class ConsolePortConnectionForm(BootstrapMixin, forms.ModelForm):
queryset=ConsoleServerPort.objects.all(),
label='Port',
widget=APISelect(
api_url='/api/dcim/console-server-ports/?device_id={{device}}',
api_url='/api/dcim/console-server-ports/?device_id={{console_server}}',
disabled_indicator='connected_console',
)
)
Expand Down Expand Up @@ -1244,7 +1244,7 @@ class PowerPortConnectionForm(BootstrapMixin, forms.ModelForm):
queryset=PowerOutlet.objects.all(),
label='Outlet',
widget=APISelect(
api_url='/api/dcim/power-outlets/?device_id={{device}}',
api_url='/api/dcim/power-outlets/?device_id={{pdu}}',
disabled_indicator='connected_port'
)
)
Expand Down
1 change: 1 addition & 0 deletions netbox/dcim/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
from django.utils.html import escape
from django.utils.http import urlencode
from django.utils.safestring import mark_safe
from django.views.generic import View
Expand Down
2 changes: 1 addition & 1 deletion netbox/extras/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def image_upload(instance, filename):
elif instance.name:
filename = instance.name

return '{}{}_{}_{}'.format(path, instance.content_type.name, instance.object_id, filename)
return u'{}{}_{}_{}'.format(path, instance.content_type.name, instance.object_id, filename)


@python_2_unicode_compatible
Expand Down
2 changes: 1 addition & 1 deletion netbox/netbox/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
)


VERSION = '2.0.0'
VERSION = '2.0.1'

# Import local configuration
ALLOWED_HOSTS = DATABASE = SECRET_KEY = None
Expand Down
2 changes: 1 addition & 1 deletion netbox/netbox/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def get(self, request):
results.append({
'name': queryset.model._meta.verbose_name_plural,
'table': table,
'url': '{}?q={}'.format(reverse(url), form.cleaned_data['q'])
'url': u'{}?q={}'.format(reverse(url), form.cleaned_data['q'])
})

return render(request, 'search.html', {
Expand Down
15 changes: 8 additions & 7 deletions netbox/project-static/js/secrets.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ $(document).ready(function() {

// Adding/editing a secret
$('form').submit(function(event) {
if (
$(this).find('input.requires-session-key').filter(function() {return this.value == ""}) &&
document.cookie.indexOf('session_key') == -1
) {
$('#privkey_modal').modal('show');
event.preventDefault();
}
$(this).find('input.requires-session-key').each(function() {
if (this.value && document.cookie.indexOf('session_key') == -1) {
console.log('Field ' + this.value + ' requires a session key');
$('#privkey_modal').modal('show');
event.preventDefault();
return false;
}
});
});

// Retrieve a session key
Expand Down

0 comments on commit f731900

Please sign in to comment.