Skip to content

Commit

Permalink
Add imagegallery endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasdeluna committed Apr 18, 2023
1 parent efb4461 commit 9625172
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
9 changes: 0 additions & 9 deletions ().py

This file was deleted.

1 change: 0 additions & 1 deletion lego/apps/events/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ def upcoming(self, request):
def imagegallery(self, request):
queryset = File.objects.filter(

Check warning on line 308 in lego/apps/events/views.py

View check run for this annotation

Codecov / codecov/patch

lego/apps/events/views.py#L308

Added line #L308 was not covered by tests
file_type=constants.IMAGE,
public=True,
save_for_use=True,
)
serializer = self.get_serializer(queryset, many=True)
Expand Down
1 change: 0 additions & 1 deletion lego/apps/files/migrations/0005_file_save_for_use.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("files", "0004_auto_20200907_2209"),
]
Expand Down
1 change: 0 additions & 1 deletion lego/apps/files/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class FileUploadSerializer(serializers.Serializer):


class ImageGalleryCoverSerializer(serializers.ModelSerializer):

file = ImageField(
source="self", required=False, options={"height": 700, "smart": True}
)
Expand Down
6 changes: 5 additions & 1 deletion lego/apps/files/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ def create(self, request, *args, **kwargs):
status=status.HTTP_201_CREATED,
)

@decorators.action(detail=True, methods=["PATCH"])
@decorators.action(
detail=True,
methods=["PATCH"],
permission_classes=[permissions.AllowAny],
)
def set_save_for_use(self, request, *args, **kwargs):
file = self.get_object()
serializer = FileSaveForUseSerializer(data=request.data)
Expand Down

0 comments on commit 9625172

Please sign in to comment.