From 6929d2740df81a1f958da919aaf2d2467b59e1bd Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sat, 14 Mar 2020 22:31:42 +0100 Subject: [PATCH] do not raise error if setting is not changed --- tiramisu/storage/postgres/storage.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tiramisu/storage/postgres/storage.py b/tiramisu/storage/postgres/storage.py index 6650dbf..b4caeb2 100644 --- a/tiramisu/storage/postgres/storage.py +++ b/tiramisu/storage/postgres/storage.py @@ -35,6 +35,8 @@ class Setting: self.dsn = 'postgres:///tiramisu?host=/var/run/postgresql/&user=tiramisu' def __setattr__(self, key, value): + if hasattr(self, key) and getattr(self, key) == value: + return if POOL is not None: # pragma: no cover raise Exception(_('cannot change setting when connexion is already ' 'opened'))