Эх сурвалжийг харах

use map in comprehension when iterating ingredients

Daniel Sheffield 2 жил өмнө
parent
commit
c159fa55e0

+ 1 - 5
app/activities/RecipeEditor.py

@@ -269,11 +269,7 @@ class RecipeEditor(FocusWidget):
         yml = dict()
         yml['ingredients'] = list(map(lambda x: ' '.join(x), filter(
             lambda x: None not in map(lambda x: x or None, x), [
-            (
-                x[0].get_edit_text(),
-                x[1].get_text()[0],
-                x[2].get_edit_text(),
-            ) for x in self.ingredients
+                list(map(lambda x: x.get_edit_text(), x)) for x in self.ingredients
         ])))
         serves = self.feeds.value()
         if serves: