Self hosted FLOSS fitness/workout, nutrition and weight tracker
Automatic linting
Github-actions712d03e154a7
diff --git a/wger/nutrition/helpers.py b/wger/nutrition/helpers.pyindex 74e7e2e95..09b4f68e8 100644--- a/wger/nutrition/helpers.py+++ b/wger/nutrition/helpers.py@@ -24,9 +24,9 @@ from typing import Union# wgerfrom wger.nutrition.consts import (+ KJ_PER_KCAL,MEALITEM_WEIGHT_GRAM,MEALITEM_WEIGHT_UNIT,- KJ_PER_KCAL,)@@ -126,15 +126,15 @@ class NutritionalValues:protein=self.protein + other.protein,carbohydrates=self.carbohydrates + other.carbohydrates,carbohydrates_sugar=self.carbohydrates_sugar +- other.carbohydrates_sugar if self.carbohydrates_sugar and other.carbohydrates_sugar else+ other.carbohydrates_sugar if self.carbohydrates_sugar and other.carbohydrates_sugar elseself.carbohydrates_sugar or other.carbohydrates_sugar,fat=self.fat + other.fat,fat_saturated=self.fat_saturated + other.fat_saturated if self.fat_saturated- and other.fat_saturated else self.fat_saturated or other.fat_saturated,+ and other.fat_saturated else self.fat_saturated or other.fat_saturated,fibres=self.fibres +- other.fibres if self.fibres and other.fibres else self.fibres or other.fibres,+ other.fibres if self.fibres and other.fibres else self.fibres or other.fibres,sodium=self.sodium +- other.sodium if self.sodium and other.sodium else self.sodium or other.sodium,+ other.sodium if self.sodium and other.sodium else self.sodium or other.sodium,)@propertydiff --git a/wger/nutrition/management/commands/import-off-products.py b/wger/nutrition/management/commands/import-off-products.pyindex a72c52650..bc263a830 100644--- a/wger/nutrition/management/commands/import-off-products.py+++ b/wger/nutrition/management/commands/import-off-products.py@@ -25,6 +25,7 @@ from wger.core.models import Languagefrom wger.nutrition.models import Ingredientfrom wger.nutrition.off import extract_info_from_off+logger = logging.getLogger(__name__)@@ -56,8 +57,8 @@ class Command(BaseCommand):dest='mode',type=str,help='Script mode, "insert" or "update". Insert will insert the ingredients as new '- 'entries in the database, while update will try to update them if they are '- 'already present. Deault: insert'+ 'entries in the database, while update will try to update them if they are '+ 'already present. Deault: insert')parser.add_argument('--completeness',@@ -66,7 +67,7 @@ class Command(BaseCommand):dest='completeness',type=float,help='Completeness threshold for importing the products. Products in OFF have '- 'completeness score that ranges from 0 to 1.1. Default: 0.7'+ 'completeness score that ranges from 0 to 1.1. Default: 0.7')def handle(self, **options):diff --git a/wger/nutrition/models/ingredient.py b/wger/nutrition/models/ingredient.pyindex 84cba0098..36b312140 100644--- a/wger/nutrition/models/ingredient.py+++ b/wger/nutrition/models/ingredient.py@@ -65,6 +65,7 @@ from wger.utils.models import (# Localfrom .ingredient_category import IngredientCategory+logger = logging.getLogger(__name__)diff --git a/wger/nutrition/off.py b/wger/nutrition/off.pyindex daaea6852..c033935bc 100644--- a/wger/nutrition/off.py+++ b/wger/nutrition/off.py@@ -19,6 +19,7 @@ from wger.nutrition.models import Sourcefrom wger.utils.constants import ODBL_LICENSE_IDfrom wger.utils.models import AbstractSubmissionModel+OFF_REQUIRED_TOP_LEVEL = ['product_name','code',diff --git a/wger/nutrition/tests/test_off.py b/wger/nutrition/tests/test_off.pyindex ab413d9c0..07532df99 100644--- a/wger/nutrition/tests/test_off.py+++ b/wger/nutrition/tests/test_off.py@@ -13,6 +13,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.+# Djangofrom django.test import SimpleTestCase# wger