Another attempt at getting the VPN form to work
diff --git a/xos/services/vpn/admin.py b/xos/services/vpn/admin.py
index f79d98d..708e3e7 100644
--- a/xos/services/vpn/admin.py
+++ b/xos/services/vpn/admin.py
@@ -86,7 +86,7 @@
self.fields['is_persistent'].initial = self.instance.is_persistent
self.fields[
'can_view_subnet'].initial = self.instance.can_view_subnet
- self.fields['script_name'].initial = self.instance.file_name
+ self.fields['script_name'].initial = self.instance.script_name
if (not self.instance) or (not self.instance.pk):
self.fields['creator'].initial = get_request().user
@@ -106,7 +106,7 @@
self.instance.server_address = self.cleaned_data.get("server_address")
self.instance.client_address = self.cleaned_data.get("client_address")
self.instance.is_persistent = self.cleaned_data.get('is_persistent')
- self.instance.file_name = self.clean_script_name()
+ self.instance.script_name = self.clean_script_name()
self.instance.can_view_subnet = self.cleaned_data.get(
'can_view_subnet')
return super(VPNTenantForm, self).save(commit=commit)
diff --git a/xos/services/vpn/models.py b/xos/services/vpn/models.py
index 3f996fa..ba9c505 100644
--- a/xos/services/vpn/models.py
+++ b/xos/services/vpn/models.py
@@ -31,7 +31,7 @@
'client_address': '10.8.0.2',
'can_view_subnet': False,
'is_persistent': True,
- 'file_name': 'Not found'}
+ 'script_name': 'Not found'}
def __init__(self, *args, **kwargs):
vpn_services = VPNService.get_service_objects().all()
@@ -137,12 +137,12 @@
self.set_attribute("can_view_subnet", value)
@property
- def file_name(self):
- self.get_attribute("file_name", self.default_attributes['file_name'])
+ def script_name(self):
+ self.get_attribute("script_name", self.default_attributes['script_name'])
- @file_name.setter
- def file_name(self, value):
- self.set_attribute("file_name", value)
+ @script_name.setter
+ def script_name(self, value):
+ self.set_attribute("script_name", value)
def model_policy_vpn_tenant(pk):