Skip to content

Commit

Permalink
Merge pull request #82 from capivarasdev/upstream-image_raw
Browse files Browse the repository at this point in the history
change image_raw to async
  • Loading branch information
sirodoht authored Jul 31, 2024
2 parents 251e294 + 5e001a7 commit 7eaca71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main/views/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,8 @@ def form_valid(self, form):
return HttpResponseRedirect(self.get_success_url())


def image_raw(request, slug, extension):
image = models.Image.objects.filter(slug=slug).first()
async def image_raw(request, slug, extension):
image = await models.Image.objects.filter(slug=slug).afirst()
if not image or extension != image.extension:
raise Http404()
return HttpResponse(image.data, content_type="image/" + image.extension)
Expand Down

0 comments on commit 7eaca71

Please sign in to comment.