Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

Commit

Permalink
[django] Upgraded to django 1.11 #51
Browse files Browse the repository at this point in the history
Closes #51
  • Loading branch information
nemesifier committed Jul 6, 2017
1 parent 26f5cd4 commit 03a9ef8
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 15 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ python:
- "3.4"
- "2.7"

env:
- DJANGO="django>=1.10,<1.11"

branches:
only:
- master
Expand All @@ -20,7 +17,6 @@ before_install:
- ./runisort

install:
- pip install $DJANGO
- python setup.py -q develop

script:
Expand Down
2 changes: 1 addition & 1 deletion django_netjsonconfig/base/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def preview_view(self, request):
templates = template_model.objects.filter(pk__in=template_ids.split(','))
try:
templates = list(templates) # evaluating queryset performs query
except ValueError as e:
except ValidationError as e:
logger.exception(error_msg, extra={'request': request})
return HttpResponse(str(e), status=400)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ a.jsoneditor-exit:focus{ text-decoration: none }
box-sizing: border-box;
}

.readonly{
input.readonly{
border: 1px solid rgba(0, 0, 0, 0.05) !important;
background-color: rgba(0, 0, 0, 0.070);
}
Expand Down Expand Up @@ -94,7 +94,7 @@ a.jsoneditor-exit:focus{ text-decoration: none }
.field-vpn, .field-auto_cert{
display: none;
}
#container .help{ margin-top: 2px; font-size: 13px }
#container .help{ margin-top: 3px; font-size: 13px }
#container .help a,
#netjsonconfig-hint a, #netjsonconfig-hint-advancedmode a{ text-decoration: underline }
#netjsonconfig-hint, #netjsonconfig-hint-advancedmode { width: auto }
Expand Down
6 changes: 3 additions & 3 deletions django_netjsonconfig/static/django-netjsonconfig/js/uuid.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
django.jQuery(function($) {
var p = $('.field-id_hex p').eq(0),
value = p.text();
p.html('<input readonly id="id_id" type="text" class="vTextField readonly" value="'+ value +'">');
var container = $('.field-id_hex .readonly').eq(0),
value = container.text();
container.html('<input readonly id="id_id" type="text" class="vTextField readonly" value="'+ value +'">');
var id = $('#id_id');
id.click(function(){
$(this).select()
Expand Down
2 changes: 1 addition & 1 deletion django_netjsonconfig/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,4 @@ def test_preview_vpn(self):
def test_add_vpn(self):
path = reverse('admin:django_netjsonconfig_vpn_add')
response = self.client.get(path)
self.assertContains(response, 'value="django_netjsonconfig.vpn_backends.OpenVpn" selected="selected"')
self.assertContains(response, 'value="django_netjsonconfig.vpn_backends.OpenVpn" selected')
3 changes: 2 additions & 1 deletion django_netjsonconfig/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging

from django.conf.urls import url
from django.core.exceptions import ValidationError
from django.http import Http404, HttpResponse
from django.shortcuts import get_object_or_404 as base_get_object_or_404
from django.utils.crypto import get_random_string
Expand All @@ -16,7 +17,7 @@ def get_object_or_404(model, **kwargs):
"""
try:
return base_get_object_or_404(model, **kwargs)
except ValueError:
except ValidationError:
raise Http404()


Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
django>=1.9,<1.11
django>=1.11,<1.12
django-model-utils
jsonfield
six
netjsonconfig>=0.5.4,<0.7.0
django-sortedm2m>=1.3.2,<1.4
django-sortedm2m>=1.4.0,<1.5
django-reversion>=2.0.6,<2.1
django-x509>=0.2.0,<0.3.0
django-taggit>=0.22.1,<0.23.0
openwisp-utils<0.2
openwisp-utils<0.2

0 comments on commit 03a9ef8

Please sign in to comment.