Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Remove source_url field

Roland Geidercb182a5328e3
diff --git a/wger/nutrition/api/serializers.py b/wger/nutrition/api/serializers.py
index d0c97ac6d..8d19f95b6 100644
--- a/wger/nutrition/api/serializers.py
+++ b/wger/nutrition/api/serializers.py
@@ -92,7 +92,6 @@ class ImageSerializer(serializers.ModelSerializer):
'image',
'last_update',
'size',
- 'source_url',
'license',
'license_title',
'license_object_url',
diff --git a/wger/nutrition/api/views.py b/wger/nutrition/api/views.py
index b99979382..4c2de3c4c 100644
--- a/wger/nutrition/api/views.py
+++ b/wger/nutrition/api/views.py
@@ -207,7 +207,7 @@ class ImageViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Image.objects.all()
serializer_class = ImageSerializer
ordering_fields = '__all__'
- filterset_fields = ('uuid', 'source_url', 'ingredient_id', 'ingredient__uuid')
+ filterset_fields = ('uuid', 'ingredient_id', 'ingredient__uuid')
@method_decorator(cache_page(settings.WGER_SETTINGS['EXERCISE_CACHE_TTL']))
def dispatch(self, request, *args, **kwargs):
diff --git a/wger/nutrition/migrations/0013_ingredient_image.py b/wger/nutrition/migrations/0013_ingredient_image.py
index b282a3ba2..c5e155cd7 100644
--- a/wger/nutrition/migrations/0013_ingredient_image.py
+++ b/wger/nutrition/migrations/0013_ingredient_image.py
@@ -82,7 +82,6 @@ class Migration(migrations.Migration):
),
('last_update', models.DateTimeField(auto_now=True)),
('size', models.IntegerField()),
- ('source_url', models.URLField()),
(
'ingredient',
models.OneToOneField(
diff --git a/wger/nutrition/models/image.py b/wger/nutrition/models/image.py
index 5cbf5b7f8..5e679e46d 100644
--- a/wger/nutrition/models/image.py
+++ b/wger/nutrition/models/image.py
@@ -69,9 +69,6 @@ class Image(AbstractLicenseModel, models.Model, BaseImage):
size = models.IntegerField()
"""The size of the image in bytes"""
- source_url = models.URLField()
- """The source of the image"""
-
@classmethod
def from_json(
cls,
diff --git a/wger/nutrition/tests/test_tasks.py b/wger/nutrition/tests/test_tasks.py
index 09b5b9310..23ad84bb7 100644
--- a/wger/nutrition/tests/test_tasks.py
+++ b/wger/nutrition/tests/test_tasks.py
@@ -80,7 +80,6 @@ class MockWgerApiResponse:
"188324b5-587f-42d7-9abc-d2ca64c73d45.jpg",
"last_update": "2023-03-15T23:20:10.969369+01:00",
"size": 20179,
- "source_url": "",
"license": 1,
"license_author": "Tester McTest",
"license_author_url": "https://example.com/editors/mcLovin",