gen
This commit is contained in:
@@ -14,6 +14,7 @@ from django.db.models import Q
|
|||||||
from .forms import GenerateForm
|
from .forms import GenerateForm
|
||||||
from .models import GithubRun
|
from .models import GithubRun
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
from urllib.parse import quote
|
||||||
|
|
||||||
def generator_view(request):
|
def generator_view(request):
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
@@ -324,7 +325,7 @@ def startgh(request):
|
|||||||
return HttpResponse('')
|
return HttpResponse('')
|
||||||
|
|
||||||
def save_png(file, uuid, domain):
|
def save_png(file, uuid, domain):
|
||||||
file_save_path = "png/%s/%s" % (uuid, file.name)
|
file_save_path = "png/%s/%s" % (uuid, quote(file.name))
|
||||||
Path("png/%s" % uuid).mkdir(parents=True, exist_ok=True)
|
Path("png/%s" % uuid).mkdir(parents=True, exist_ok=True)
|
||||||
with open(file_save_path, "wb+") as f:
|
with open(file_save_path, "wb+") as f:
|
||||||
for chunk in file.chunks():
|
for chunk in file.chunks():
|
||||||
@@ -332,6 +333,6 @@ def save_png(file, uuid, domain):
|
|||||||
imageJson = {}
|
imageJson = {}
|
||||||
imageJson['url'] = domain
|
imageJson['url'] = domain
|
||||||
imageJson['uuid'] = uuid
|
imageJson['uuid'] = uuid
|
||||||
imageJson['file'] = file.name
|
imageJson['file'] = quote(file.name)
|
||||||
#return "%s/%s" % (domain, file_save_path)
|
#return "%s/%s" % (domain, file_save_path)
|
||||||
return json.dumps(imageJson)
|
return json.dumps(imageJson)
|
||||||
Reference in New Issue
Block a user