Skip to content

Commit

Permalink
[#4009] Replace usage of get_merged_data
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Apr 3, 2024
1 parent 1e15483 commit afebb3b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/openforms/formio/formatters/tests/test_kitchensink.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

def _get_printable_data(submission: Submission) -> list[tuple[str, Any]]:
printable_data: list[tuple[str, Any]] = []
merged_data = submission.get_merged_data()
merged_data = submission.data

for component in filter_printable(submission.form.iter_components(recursive=True)):
key = component["key"]
Expand Down
2 changes: 1 addition & 1 deletion src/openforms/registrations/contrib/camunda/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_process_variables(
]
)

merged_data: dict[str, Any] = submission.get_merged_data()
merged_data = submission.data
for component in submission.form.iter_components(recursive=True):
if (key := component.get("key")) not in simple_mappings:
continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def register_submission(self, submission: Submission, options: dict) -> None:
submission_report.content, folder_name / "report.pdf"
)

data = submission.get_merged_data()
data = submission.data
data["__metadata__"] = {"submission_language": submission.language_code}
uploader.upload_json(data, folder_name / "data.json")

Expand Down
4 changes: 2 additions & 2 deletions src/openforms/submissions/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def apply_data_mapping(
attr_key_lookup[attribute] = key

# grab submitted data
data = submission.get_merged_data()
data = submission.data

for target_path, conf in mapping_config.items():
if isinstance(conf, str):
Expand Down Expand Up @@ -137,7 +137,7 @@ def get_unmapped_data(
"""
companion to apply_data_mapping() returns data not mapped to RegistrationAttributes
"""
data = submission.get_merged_data()
data = submission.data

attr_key_lookup = dict()

Expand Down
2 changes: 1 addition & 1 deletion src/openforms/submissions/models/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def get_merged_appointment_data(self) -> dict[str, dict[str, str | dict]]:
"appointments.phoneNumber": "clientPhoneNumber",
}

merged_data = self.get_merged_data()
merged_data = self.data
appointment_data = {}

for component in self.form.iter_components(recursive=True):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,7 @@ def test_response_contains_submission(self):
self._add_submission_to_session(submission)

with freeze_time("2015-10-10"):
response = self.client.post(
endpoint, {"data": submission.get_merged_data()}
)
response = self.client.post(endpoint, {"data": submission.data})

submission_details = response.json()

Expand Down
6 changes: 3 additions & 3 deletions src/openforms/submissions/tests/test_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_from_components__with_data(self):
},
)

actual = submission.get_merged_data()
actual = submission.data
expected = {"foo": 1, "bar": 2}
self.assertEqual(actual, expected)

Expand Down Expand Up @@ -94,7 +94,7 @@ def test_from_data__simple(self):
}
)

actual = submission.get_merged_data()
actual = submission.data
expected = {
"foo": 1,
"bar": 2,
Expand All @@ -111,7 +111,7 @@ def test_from_data__kwargs(self):
kvk="111222333",
)

actual = submission.get_merged_data()
actual = submission.data
expected = {
"foo": 1,
"bar": 2,
Expand Down

0 comments on commit afebb3b

Please sign in to comment.