fix some stuff the pycharm code checker found
it also thought the db param of init_db is not needed, but it is, added a comment there
This commit is contained in:
parent
979f2f8b3e
commit
252a7e5d0b
@ -30,7 +30,7 @@ from django.utils.translation import activate
|
|||||||
|
|
||||||
# Note: fixture must be "function" scope (default), see https://github.com/pelme/pytest_django/issues/33
|
# Note: fixture must be "function" scope (default), see https://github.com/pelme/pytest_django/issues/33
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def db_init(db):
|
def db_init(db): # note: db is a predefined fixture and required here to have the db available
|
||||||
"""
|
"""
|
||||||
Init the database contents for testing, so we have a service domain, ...
|
Init the database contents for testing, so we have a service domain, ...
|
||||||
"""
|
"""
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ import dns.update
|
|||||||
import dns.tsig
|
import dns.tsig
|
||||||
import dns.tsigkeyring
|
import dns.tsigkeyring
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.utils.timezone import now
|
from django.utils.timezone import now
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,17 +36,17 @@
|
|||||||
We populated the input fields for the new addresses with your currently detected remote addresses.
|
We populated the input fields for the new addresses with your currently detected remote addresses.
|
||||||
</p>
|
</p>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Current IPv4 address from master nameserver</label>
|
<label for="current_ipv4">Current IPv4 address from master nameserver</label>
|
||||||
<input class="form-control" type="text" id="current_ipv4" name="current_ipv4" value="{{ host.getIPv4 }}" disabled>
|
<input class="form-control" type="text" id="current_ipv4" name="current_ipv4" value="{{ host.getIPv4 }}" disabled>
|
||||||
<label>Set new IPv4 address</label>
|
<label for="myipv4">Set new IPv4 address</label>
|
||||||
<input class="form-control" type="text" id="myipv4" name="myipv4" placeholder="give new ipv4 address" value="{{ request.session.ipv4 }}" required>
|
<input class="form-control" type="text" id="myipv4" name="myipv4" placeholder="give new ipv4 address" value="{{ request.session.ipv4 }}" required>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-primary" onclick="update_host_v4('{{ host.get_fqdn }}')">Apply</button> <span id="update_result_v4"></span>
|
<button type="button" class="btn btn-primary" onclick="update_host_v4('{{ host.get_fqdn }}')">Apply</button> <span id="update_result_v4"></span>
|
||||||
<p></p>
|
<p></p>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Current IPv6 address from master nameserver</label>
|
<label for="current_ipv6">Current IPv6 address from master nameserver</label>
|
||||||
<input class="form-control" type="text" id="current_ipv6" name="current_ipv6" value="{{ host.getIPv6 }}" disabled>
|
<input class="form-control" type="text" id="current_ipv6" name="current_ipv6" value="{{ host.getIPv6 }}" disabled>
|
||||||
<label>Set new IPv6 address</label>
|
<label for="myipv6">Set new IPv6 address</label>
|
||||||
<input class="form-control" type="text" id="myipv6" name="myipv6" placeholder="give new ipv6 address" value="{{ request.session.ipv6 }}" required>
|
<input class="form-control" type="text" id="myipv6" name="myipv6" placeholder="give new ipv6 address" value="{{ request.session.ipv6 }}" required>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-primary" onclick="update_host_v6('{{ host.get_fqdn }}')">Apply</button> <span id="update_result_v6"></span>
|
<button type="button" class="btn btn-primary" onclick="update_host_v6('{{ host.get_fqdn }}')">Apply</button> <span id="update_result_v6"></span>
|
||||||
@ -59,7 +59,7 @@
|
|||||||
}).fail(function( data ) {
|
}).fail(function( data ) {
|
||||||
$('#update_result_v4').text('error');
|
$('#update_result_v4').text('error');
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
update_host_v6 = function(host) {
|
update_host_v6 = function(host) {
|
||||||
$('#update_result_v6').text('updating...');
|
$('#update_result_v6').text('updating...');
|
||||||
$.get( "{% url 'nic_update_authorized' %}", { myip: $('#myipv6').val(), hostname: host } )
|
$.get( "{% url 'nic_update_authorized' %}", { myip: $('#myipv6').val(), hostname: host } )
|
||||||
@ -68,7 +68,7 @@
|
|||||||
}).fail(function( data ) {
|
}).fail(function( data ) {
|
||||||
$('#update_result_v6').text('error');
|
$('#update_result_v6').text('error');
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import dns.inet
|
|
||||||
|
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.views.generic import TemplateView, CreateView
|
from django.views.generic import TemplateView, CreateView
|
||||||
from django.views.generic.edit import UpdateView, DeleteView
|
from django.views.generic.edit import UpdateView, DeleteView
|
||||||
|
@ -3,7 +3,6 @@ Django settings for nsupdate project
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import dns.tsig
|
|
||||||
import django.conf.global_settings as DEFAULT_SETTINGS
|
import django.conf.global_settings as DEFAULT_SETTINGS
|
||||||
|
|
||||||
# Use a unique, long, random, secret string here.
|
# Use a unique, long, random, secret string here.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user