Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.

Commit 0b67ef1

Browse files
committed
No need to query for the latest tls settings.
1 parent e2baf85 commit 0b67ef1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

rootfs/api/models/tls.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,13 @@ def save(self, *args, **kwargs):
6262
def sync(self):
6363
try:
6464
app = str(self.app)
65-
previous_tls_settings = self.app.tls_set.latest()
6665

6766
config = self._load_service_config(app, 'router')
6867
if (
69-
config['ssl']['enforce'] != str(previous_tls_settings.https_enforced) and
70-
previous_tls_settings.https_enforced is not None
68+
config['ssl']['enforce'] != str(self.https_enforced) and
69+
self.https_enforced is not None
7170
):
72-
config['ssl']['enforce'] = str(previous_tls_settings.https_enforced)
71+
config['ssl']['enforce'] = str(self.https_enforced)
7372
self._save_service_config(app, 'router', config)
7473
except TLS.DoesNotExist:
7574
pass

0 commit comments

Comments
 (0)