From c54beb76d36330c30254164be0099957d57923ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Thu, 12 Jan 2023 09:03:37 +0100 Subject: [PATCH] fix #3 A conversion to a lowercase string is needed for boolean values --- mastodon_blocklist_deploy/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mastodon_blocklist_deploy/models.py b/mastodon_blocklist_deploy/models.py index f58d85a..5997ab0 100644 --- a/mastodon_blocklist_deploy/models.py +++ b/mastodon_blocklist_deploy/models.py @@ -63,11 +63,11 @@ class Instance: } data = {"domain": self.domain, "severity": self.severity, - "reject_media": self.reject_media, - "reject_reports": self.reject_reports, - "private_comment": self.private_comment, + "reject_media": str(self.reject_media).lower(), + "reject_reports": str(self.reject_reports).lower(), + "private_comment": str(self.private_comment).lower(), "public_comment": self.public_comment, - "obfuscate": self.obfuscate} + "obfuscate": str(self.obfuscate).lower()} """If no id is given add a new block, else update the existing block""" if block_id is None: response = requests.post(f'https://{server}/api/v1/admin/domain_blocks', data=data, headers=headers)