Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Pass project URL to user agent

Roland Geider98c66db5104f
diff --git a/wger/exercises/management/commands/download-exercise-images.py b/wger/exercises/management/commands/download-exercise-images.py
index d7c3cb5c1..20de3dcbc 100644
--- a/wger/exercises/management/commands/download-exercise-images.py
+++ b/wger/exercises/management/commands/download-exercise-images.py
@@ -85,7 +85,7 @@ class Command(BaseCommand):
except ValidationError:
raise CommandError('Please enter a valid URL')
- headers = {'User-agent': default_user_agent('wger/{} + requests'.format(get_version()))}
+ headers = {'User-agent': default_user_agent(f'wger/{get_version()} + requests')}
# Get all images
page = 1
@@ -109,7 +109,7 @@ class Command(BaseCommand):
continue
try:
- image = ExerciseImage.objects.get(uuid=image_uuid)
+ ExerciseImage.objects.get(uuid=image_uuid)
self.stdout.write(' Image already present locally, skipping...')
continue
except ExerciseImage.DoesNotExist:
diff --git a/wger/nutrition/management/commands/download-ingredient-images.py b/wger/nutrition/management/commands/download-ingredient-images.py
index 8f603d051..0bad30774 100644
--- a/wger/nutrition/management/commands/download-ingredient-images.py
+++ b/wger/nutrition/management/commands/download-ingredient-images.py
@@ -80,7 +80,7 @@ class Command(BaseCommand):
except ValidationError:
raise CommandError('Please enter a valid URL')
- headers = {'User-agent': default_user_agent(f'wger/{get_version()} + requests')}
+ headers = {'User-agent': f'wger/{get_version()} https://github.com/wger-project'}
# Get all images
page = 1