From 475d12237517c42b413ba48dea48cb7801293df9 Mon Sep 17 00:00:00 2001 From: Viktor van Wijk Date: Fri, 20 Dec 2024 14:26:50 +0100 Subject: [PATCH] :bulb: [#4908] Update TODOs "Any other fields that need special attention?": Not for the moment, all the fields are JSON serializable "Service type relevant?": Yes, but not here. In the serializer, it should only show the services of type ORC. The other ones are not relevant for this plugin "Does execute_unless_result_exists need to be used?": Not for this plugin. It is normally used in plugins where a lot of API calls are made, where it prevents objects from being created multiple times on retries (when one or multiple API calls had failed). --- .../registrations/contrib/json/plugin.py | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/src/openforms/registrations/contrib/json/plugin.py b/src/openforms/registrations/contrib/json/plugin.py index c3276a7c1c..adb47bab8f 100644 --- a/src/openforms/registrations/contrib/json/plugin.py +++ b/src/openforms/registrations/contrib/json/plugin.py @@ -19,12 +19,6 @@ class JSONRegistration(BasePlugin): configuration_options = JSONOptionsSerializer def register_submission(self, submission: Submission, options: JSONOptions) -> None: - # TODO-4908: the email plugin works with a EmailConfig singleton model. Is that useful here? - # Doesn't look like it. Seems to be used as a model for default configuration options, which - # which wouldn't really be useful for this plugin - - # TODO-4908: any other form field types that need 'special attention'? - values = {} # Encode (base64) and add attachments to values dict if their form keys were specified in the # form variables list @@ -58,7 +52,6 @@ def register_submission(self, submission: Submission, options: JSONOptions) -> N # Send to the service json = {"values": values} service = options["service"] - # TODO-4098: is the service type relevant here? with build_client(service) as client: response = client.post( options.get("relative_api_endpoint", ""), @@ -68,19 +61,6 @@ def register_submission(self, submission: Submission, options: JSONOptions) -> N response.raise_for_status() print(response.json()) - # TODO-4908: does this need to be used (what does it even do, there is no documentation)? - # If so, what to put in spec? - # result = execute_unless_result_exists( - # partial( - # client.post, - # options["relative_api_endpoint"], - # json=json, - # headers={}, - # ), - # submission, - # spec="???", - # ) - # TODO-4908: added return for testing purposes return json