From cc3da97e6b16cc7bbaefbe82f6b85e28b5c6d3c1 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Wed, 11 Sep 2024 00:22:51 +0500 Subject: [PATCH] Handle potential case when tos can be null This commit fixes a case where tos can be null which we get from an ACME provider. In the database we keep it as an empty string because this needs to go through the libraries we are using to generate an ACME certificate which can/cannot error out and unfortunately we don't have an ACME provider atm which gives a null tos to test a null case. Keeping it as an empty string in that case in database if tos received is null. --- src/middlewared/middlewared/plugins/acme_protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middlewared/middlewared/plugins/acme_protocol.py b/src/middlewared/middlewared/plugins/acme_protocol.py index d95bf19a4a82d..72dd9a173e788 100644 --- a/src/middlewared/middlewared/plugins/acme_protocol.py +++ b/src/middlewared/middlewared/plugins/acme_protocol.py @@ -171,7 +171,7 @@ def do_create(self, data): self._config.datastore, { 'uri': register.uri, - 'tos': register.terms_of_service, + 'tos': register.terms_of_service or '', 'new_account_uri': directory.newAccount, 'new_nonce_uri': directory.newNonce, 'new_order_uri': directory.newOrder,