Skip to content

Commit

Permalink
💡 [#4908] Update TODOs
Browse files Browse the repository at this point in the history
"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).
  • Loading branch information
viktorvanwijk committed Dec 20, 2024
1 parent 8292d01 commit 475d122
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/openforms/registrations/contrib/json/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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", ""),
Expand All @@ -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

Expand Down

0 comments on commit 475d122

Please sign in to comment.