Move initializing the form to inside the if statement so it doesn't get overwritten

This commit is contained in:
leigh-mil 2019-03-13 16:41:42 -04:00
parent a2754d0646
commit 38a1dd1b6d

View File

@ -84,6 +84,11 @@ class ShowTaskOrderWorkflow:
if self._form:
pass
elif self.task_order:
if self.pf_attributes_read_only and self.screen == 1:
self._form = task_order_form.AppInfoWithExistingPortfolioForm(
obj=self.task_order
)
else:
self._form = self._section[form_type](obj=self.task_order)
# manually set SelectMultipleFields
if self._section["section"] == "app_info":
@ -101,12 +106,6 @@ class ShowTaskOrderWorkflow:
else:
self._form = self._section[form_type]()
if self.pf_attributes_read_only and self.screen == 1:
self._form = task_order_form.AppInfoWithExistingPortfolioForm(
obj=self.task_order
)
return self._form
@property