From 2e08b298012ec76507774728f542466a23964f9d Mon Sep 17 00:00:00 2001 From: msm Date: Sun, 8 Jan 2023 17:49:42 +0100 Subject: [PATCH 1/2] Add remove_comment function to object --- mwdblib/object.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mwdblib/object.py b/mwdblib/object.py index 389f67b..057b4c9 100644 --- a/mwdblib/object.py +++ b/mwdblib/object.py @@ -387,6 +387,17 @@ def remove_attribute(self, attribute_id: int) -> None: ) self._expire("attributes") + @APIClient.requires("2.6.0") + def remove_comment(self, comment_id: int) -> None: + """ + Remove specific comment from object + + :param comment_id: Comment id + :type comment_id: int + """ + self.api.delete(f"object/{self.id}/comment/{comment_id}") + self._expire("comments") + @add_attribute.fallback("2.0.0") def _add_attribute_fallback(self, key: str, value: str) -> None: self._add_metakey(key, value) From 0f21ed994cfd554e1c578ad381a91a61d70a0b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Srokosz?= Date: Tue, 10 Jan 2023 13:57:09 +0100 Subject: [PATCH 2/2] Update mwdblib/object.py: remove version requirement --- mwdblib/object.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mwdblib/object.py b/mwdblib/object.py index 057b4c9..68f9552 100644 --- a/mwdblib/object.py +++ b/mwdblib/object.py @@ -387,7 +387,6 @@ def remove_attribute(self, attribute_id: int) -> None: ) self._expire("attributes") - @APIClient.requires("2.6.0") def remove_comment(self, comment_id: int) -> None: """ Remove specific comment from object