Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.
Permalink
Browse files
[admin] Fixed VPN context in preview #57
Fortunately it was just a frontend JS issue.
The preview instance was getting the UUID of the Device
object instead of the Config object, and that prevented
the system from finding the associated VPN and fill the
context VPN keys correctly.

Fixes #57
  • Loading branch information
nemesisdesign committed May 24, 2017
1 parent ddee69d commit 7a5dad9
Showing 1 changed file with 3 additions and 2 deletions.
@@ -8,6 +8,9 @@ django.jQuery(function($) {
fields = $(selectors, '#content-main form').not('#id_config_jsoneditor *'),
$id = $('#id_id'),
data = {};
// add id to POST data
// note: may be overridden by fields of OneToOne relation
if ($id.length) { data['id'] = $id.val() }
// gather data to send in POST
fields.each(function(i, field){
var $field = $(field),
@@ -23,8 +26,6 @@ django.jQuery(function($) {
}
data[name] = $field.val();
});
// add id to POST data
if ($id.length) { data['id'] = $id.val() }
// show preview
$.post(preview_url, data, function(html){
inner.html($('#content-main div', html).html());

0 comments on commit 7a5dad9

Please sign in to comment.