Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Automatic linting

Github-actions539235872d54
diff --git a/wger/nutrition/models/plan.py b/wger/nutrition/models/plan.py
index 70fbb2f36..dc4ab8c6f 100644
--- a/wger/nutrition/models/plan.py
+++ b/wger/nutrition/models/plan.py
@@ -193,7 +193,9 @@ class NutritionPlan(models.Model):
)
if closest_entry_gte is None or closest_entry_lte is None:
return closest_entry_gte or closest_entry_lte
- if abs(closest_entry_gte.date.date() - target) < abs(closest_entry_lte.date.date() - target):
+ if abs(closest_entry_gte.date.date() - target) < abs(
+ closest_entry_lte.date.date() - target
+ ):
return closest_entry_gte
else:
return closest_entry_lte
diff --git a/wger/utils/constants.py b/wger/utils/constants.py
index b2ccbf10f..8adcdb147 100644
--- a/wger/utils/constants.py
+++ b/wger/utils/constants.py
@@ -40,15 +40,15 @@ DATE_FORMATS = [
# Valid datetime formats
DATETIME_FORMATS = [
'%d.%m.%Y %H:%M:%S', # '25.10.2012 14:30:00'
- '%d.%m.%Y %H:%M', # '25.10.2012 14:30'
- '%d.%m.%y %H:%M:%S', # '25.10.12 14:30:00'
- '%d.%m.%y %H:%M', # '25.10.12 14:30'
- '%m/%d/%Y %H:%M:%S', # '10/25/2012 14:30:00'
- '%m/%d/%Y %H:%M', # '10/25/2012 14:30'
- '%m/%d/%y %H:%M:%S', # '10/25/12 14:30:00'
- '%m/%d/%y %H:%M', # '10/25/12 14:30'
- '%Y-%m-%d %H:%M:%S', # '2012-10-25 14:30:00'
- '%Y-%m-%d %H:%M', # '2012-10-25 14:30'
+ '%d.%m.%Y %H:%M', # '25.10.2012 14:30'
+ '%d.%m.%y %H:%M:%S', # '25.10.12 14:30:00'
+ '%d.%m.%y %H:%M', # '25.10.12 14:30'
+ '%m/%d/%Y %H:%M:%S', # '10/25/2012 14:30:00'
+ '%m/%d/%Y %H:%M', # '10/25/2012 14:30'
+ '%m/%d/%y %H:%M:%S', # '10/25/12 14:30:00'
+ '%m/%d/%y %H:%M', # '10/25/12 14:30'
+ '%Y-%m-%d %H:%M:%S', # '2012-10-25 14:30:00'
+ '%Y-%m-%d %H:%M', # '2012-10-25 14:30'
]
# Allowed tags, attributes and styles allowed in textareas edited with a JS
diff --git a/wger/weight/management/commands/email-weight-reminder.py b/wger/weight/management/commands/email-weight-reminder.py
index be8d625c8..c6899aaf3 100644
--- a/wger/weight/management/commands/email-weight-reminder.py
+++ b/wger/weight/management/commands/email-weight-reminder.py
@@ -21,7 +21,10 @@ from django.contrib.sites.models import Site
from django.core import mail
from django.core.management.base import BaseCommand
from django.template import loader
-from django.utils import translation, timezone
+from django.utils import (
+ timezone,
+ translation,
+)
from django.utils.translation import gettext_lazy as _
# wger
diff --git a/wger/weight/migrations/0004_multiple_weight_entries_per_day.py b/wger/weight/migrations/0004_multiple_weight_entries_per_day.py
index a83ca27d0..9fcd7bde7 100644
--- a/wger/weight/migrations/0004_multiple_weight_entries_per_day.py
+++ b/wger/weight/migrations/0004_multiple_weight_entries_per_day.py
@@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
-
dependencies = [
('weight', '0003_auto_20160416_1030'),
]
diff --git a/wger/weight/tests/test_csv_import.py b/wger/weight/tests/test_csv_import.py
index 122ac463c..f0c8f6889 100644
--- a/wger/weight/tests/test_csv_import.py
+++ b/wger/weight/tests/test_csv_import.py
@@ -64,7 +64,12 @@ class WeightCsvImportTestCase(WgerTestCase):
# 2nd. step
response = self.client.post(
reverse('weight:import-csv'),
- {'stage': 2, 'hash': hash_value, 'csv_input': csv_input, 'date_format': '%d.%m.%y %H:%M:%S'},
+ {
+ 'stage': 2,
+ 'hash': hash_value,
+ 'csv_input': csv_input,
+ 'date_format': '%d.%m.%y %H:%M:%S',
+ },
)
count_after = WeightEntry.objects.count()
diff --git a/wger/weight/tests/test_entry.py b/wger/weight/tests/test_entry.py
index b0c84bcc3..1745a6632 100644
--- a/wger/weight/tests/test_entry.py
+++ b/wger/weight/tests/test_entry.py
@@ -30,7 +30,9 @@ class MealRepresentationTestCase(WgerTestCase):
"""
Test that the representation of an object is correct
"""
- self.assertEqual(str(WeightEntry.objects.get(pk=1)), '2012-10-01 14:30:21.592000+00:00: 77.00 kg')
+ self.assertEqual(
+ str(WeightEntry.objects.get(pk=1)), '2012-10-01 14:30:21.592000+00:00: 77.00 kg'
+ )
class WeightEntryTestCase(api_base_test.ApiBaseResourceTestCase):