Skip to content
Snippets Groups Projects
Commit 453798c1 authored by Fredrik Jonsson's avatar Fredrik Jonsson
Browse files

Only deserialise stream_data to avoid run of sql queries. A drop from 1070 to 33 queries.

parent e2b82cba
No related branches found
No related tags found
No related merge requests found
...@@ -69,10 +69,12 @@ class AccessFormData: ...@@ -69,10 +69,12 @@ class AccessFormData:
def deserialised_data(cls, data, form_fields): def deserialised_data(cls, data, form_fields):
# Converts the file dicts into actual file objects # Converts the file dicts into actual file objects
data = data.copy() data = data.copy()
for field in form_fields: for field in form_fields.stream_data:
if isinstance(field.block, UploadableMediaBlock): block = form_fields.stream_block.child_blocks[field['type']]
file = data.get(field.id, []) if isinstance(block, UploadableMediaBlock):
data[field.id] = cls.process_file(file) field_id = field.get('id')
file = data.get(field_id, [])
data[field_id] = cls.process_file(file)
return data return data
def get_definitive_id(self, id): def get_definitive_id(self, id):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment