Skip to content

Commit

Permalink
Continued if there is no Mix Material name
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunga001 committed Jan 9, 2025
1 parent f725992 commit 84af203
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bika/cement/extenders/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,13 @@ def mutator(value, **kw):
msg = "Spreadsheet Mix Design and Project are Required"
pu.addPortalMessage(msg, "error")
return mutator
mix_design = self.create_mix_design(batch, mix_design_data)
design_type = mix_design_data.get("type")
if "Mortar" in design_type or "Paste" in design_type:
mortar_paste_data = self.parse_mix_design_mortar_paste_data(data)
mix_design = self.create_mix_design(batch, mix_design_data)
self.create_mortar_paste_mix_design(mix_design, mortar_paste_data)
elif design_type == "Concrete":
concrete_data = self.parse_mix_design_concrete_data(data)
mix_design = self.create_mix_design(batch, mix_design_data)
self.create_concrete_mix_design(mix_design, concrete_data)
else:
return mutator
Expand Down Expand Up @@ -285,7 +284,6 @@ def create_concrete_mix_design(self, mix_design, data):
return concrete_mix_design

def create_mortar_paste_mix_design(self, mix_design, data):
import pdb; pdb.set_trace()
mortar_paste_mix_design = mix_design.get_mix_design_mortar_paste()
if not mortar_paste_mix_design:
mortar_paste_mix_design = api.create(mix_design, "MixDesignMortarPaste")
Expand Down Expand Up @@ -315,6 +313,8 @@ def mix_materials(self, mix_design, data):
}
for mx in mix_mat_data:
m_name = mx[3]
if not m_name:
continue
query["title"] = m_name
# TODO: filter by title once the title index has been added
brains = api.search(query, SETUP_CATALOG)
Expand Down

0 comments on commit 84af203

Please sign in to comment.