Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Automatic linting

Github-actions85fb3d34fb51
diff --git a/wger/utils/context_processor.py b/wger/utils/context_processor.py
index 1acf9a97d..ca4bcaff8 100644
--- a/wger/utils/context_processor.py
+++ b/wger/utils/context_processor.py
@@ -37,42 +37,56 @@ def processor(request):
context = {
# Twitter handle for this instance
- 'twitter': settings.WGER_SETTINGS['TWITTER'],
+ 'twitter':
+ settings.WGER_SETTINGS['TWITTER'],
# Languages
- 'i18n_language': get_language_data(
+ 'i18n_language':
+ get_language_data(
(get_language(), languages_dict.get(get_language(), ENGLISH_SHORT_NAME)),
),
- 'languages': settings.AVAILABLE_LANGUAGES,
+ 'languages':
+ settings.AVAILABLE_LANGUAGES,
# The current path
- 'request_full_path': full_path,
+ 'request_full_path':
+ full_path,
# The current full path with host
- 'request_absolute_path': request.build_absolute_uri(),
- 'image_absolute_path': request.build_absolute_uri(static_path),
+ 'request_absolute_path':
+ request.build_absolute_uri(),
+ 'image_absolute_path':
+ request.build_absolute_uri(static_path),
# Translation links
- 'i18n_path': i18n_path,
- 'is_api_path': '/api/' in request.build_absolute_uri(),
+ 'i18n_path':
+ i18n_path,
+ 'is_api_path':
+ '/api/' in request.build_absolute_uri(),
# Flag for guest users
- 'has_demo_data': request.session.get('has_demo_data', False),
+ 'has_demo_data':
+ request.session.get('has_demo_data', False),
# Don't show messages on AJAX requests (they are deleted if shown)
- 'no_messages': request.META.get('HTTP_X_WGER_NO_MESSAGES', False),
+ 'no_messages':
+ request.META.get('HTTP_X_WGER_NO_MESSAGES', False),
# Default cache time for template fragment caching
- 'cache_timeout': settings.CACHES['default']['TIMEOUT'],
+ 'cache_timeout':
+ settings.CACHES['default']['TIMEOUT'],
# Used for logged in trainers
- 'trainer_identity': request.session.get('trainer.identity'),
+ 'trainer_identity':
+ request.session.get('trainer.identity'),
# current gym, if available
- 'custom_header': get_custom_header(request),
+ 'custom_header':
+ get_custom_header(request),
# Template to extend in forms, kinda ugly but will be removed in the future
- 'extend_template': 'base_empty.html' if is_ajax else 'base.html'
+ 'extend_template':
+ 'base_empty.html' if is_ajax else 'base.html'
}
# Pseudo-intelligent navigation here
diff --git a/wger/utils/helpers.py b/wger/utils/helpers.py
index bd1b1a26e..e9de454cf 100644
--- a/wger/utils/helpers.py
+++ b/wger/utils/helpers.py
@@ -217,7 +217,7 @@ def normalize_decimal(d):
normalized = d.normalize()
sign, digits, exponent = normalized.as_tuple()
if exponent > 0:
- return decimal.Decimal((sign, digits + (0,) * exponent, 0))
+ return decimal.Decimal((sign, digits + (0, ) * exponent, 0))
else:
return normalized