Revert "Fix synchronizer issue?"
This reverts commit 505bdc10af870e187249b0bd2641e628581047b3.
diff --git a/xos/services/vpn/admin.py b/xos/services/vpn/admin.py
index 312c283..8088dad 100644
--- a/xos/services/vpn/admin.py
+++ b/xos/services/vpn/admin.py
@@ -124,7 +124,8 @@
vpn_subnet = forms.GenericIPAddressField(protocol="IPv4", required=True)
is_persistent = forms.BooleanField(required=False)
clients_can_see_each_other = forms.BooleanField(required=False)
- failover_servers = forms.ModelMultipleChoiceField(required=False, queryset=VPNTenant.get_tenant_objects())
+ failover_servers = forms.ModelMultipleChoiceField(
+ required=False, queryset=VPNTenant.get_tenant_objects())
protocol = forms.ChoiceField(required=True, choices=[
("tcp", "tcp"), ("udp", "udp")])
use_ca_from = forms.ModelChoiceField(
@@ -192,7 +193,7 @@
self.instance.use_ca_from[:] = []
self.instance.use_ca_from.append(self.cleaned_data.get('use_ca_from'))
- return super(VPNTenantForm, self).save(commit=True)
+ return super(VPNTenantForm, self).save(commit=commit)
def generate_ca_crt(self):
"""str: Generates the ca cert by reading from the ca file"""
@@ -240,18 +241,18 @@
certificate = self.certificate_name(obj)
# If the client has already been reovked don't do it again
if (os.path.isfile(obj.tenant.pki_dir +
- "/issued/" + certificate + ".crt")):
+ "/issued/" + certificate + ".crt")):
VPNService.execute_easyrsa_command(
obj.tenant.pki_dir, "revoke " + certificate)
# Revoking a client cert does not delete any of the files
# to make sure that we can add this user again we need to
# delete all of the files created by easyrsa
os.remove(obj.tenant.pki_dir +
- "/issued/" + certificate + ".crt")
+ "/issued/" + certificate + ".crt")
os.remove(obj.tenant.pki_dir +
- "/private/" + certificate + ".key")
+ "/private/" + certificate + ".key")
os.remove(obj.tenant.pki_dir +
- "/reqs/" + certificate + ".req")
+ "/reqs/" + certificate + ".req")
obj.tenant.enacted = None
obj.tenant.save()
@@ -267,7 +268,7 @@
certificate = self.certificate_name(obj)
# Only add a certificate if ones does not yet exist
if (not os.path.isfile(obj.tenant.pki_dir +
- "/issued/" + certificate + ".crt")):
+ "/issued/" + certificate + ".crt")):
VPNService.execute_easyrsa_command(
obj.tenant.pki_dir,
"build-client-full " + certificate + " nopass")