Use deepcopy
to copy form section info
Previously, copying the form sections was using `list.copy` which creates a shallow copy of the list. Since the `TASK_ORDER_SECTIONS` list contains a couple dictionaries, this was just creating another list with references to the same dictionaries. Therefore, when a section was marked as completed, it was updated globally and visiting the new task order without filling anything out would show some sections as completed.
This commit is contained in:
parent
7b2e74f2f5
commit
b61a331ce6
@ -1,3 +1,5 @@
|
|||||||
|
from copy import deepcopy
|
||||||
|
|
||||||
from flask import (
|
from flask import (
|
||||||
request as http_request,
|
request as http_request,
|
||||||
render_template,
|
render_template,
|
||||||
@ -90,7 +92,7 @@ class ShowTaskOrderWorkflow:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def display_screens(self):
|
def display_screens(self):
|
||||||
screen_info = TASK_ORDER_SECTIONS.copy()
|
screen_info = deepcopy(TASK_ORDER_SECTIONS)
|
||||||
|
|
||||||
if self.task_order:
|
if self.task_order:
|
||||||
for section in screen_info:
|
for section in screen_info:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user