Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

Commit

Permalink
[Fix] CI black
Browse files Browse the repository at this point in the history
  • Loading branch information
M0NsTeRRR committed Sep 14, 2022
1 parent dd1b849 commit bb92c39
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions les_assets_generator/app/views.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from io import BytesIO
from urllib.request import urlopen
from urllib.error import HTTPError
from urllib.request import urlopen

from django.core.exceptions import PermissionDenied, ValidationError
from django.core.validators import URLValidator
from django.core.exceptions import ValidationError, PermissionDenied
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, redirect
from django.utils.translation import gettext_lazy as _
Expand Down Expand Up @@ -55,15 +55,16 @@ def generate(request, title: str):
)
else:
try:
image_to_paste = Image.open(BytesIO(urlopen(param_value).read()))
image_to_paste = Image.open(
BytesIO(urlopen(param_value).read())
)
img.paste(image_to_paste, (param.x, param.y))
except HTTPError:
return HttpResponse(
_("Error when loading logo %s" % param_value),
status=422,
)


byte_io = BytesIO()
img.save(byte_io, "png")
byte_io.seek(0)
Expand Down

0 comments on commit bb92c39

Please sign in to comment.