QS 0.9.1 PORD

This commit is contained in:
Holger Trampe 2020-06-01 01:48:15 +02:00
parent 44d69d2d26
commit 97b9cc8e26
1 changed files with 6 additions and 2 deletions

View File

@ -742,7 +742,7 @@ def support(request):
if request.method == 'POST':
form = request.POST
fileblob = ""
attachments=[] #myfile is the key of a multi value dictionary, values are the uploaded files
for f in request.FILES.getlist('attachment_1'): #myfile is the name of your html file button
filename = f.name
@ -752,6 +752,8 @@ def support(request):
fileblob = fileblob[1 : : ]
fileblob = fileblob[:-1:]
attachments.append({str(filename) : "data:" + attachment_type.mime + ";base64," + fileblob})
fileblob = "data:" + attachment_type.mime + ";base64," + fileblob
for f in request.FILES.getlist('attachment_2'): #myfile is the name of your html file button
filename = f.name
attachment_type = filetype.guess(f)
@ -795,6 +797,8 @@ def support(request):
}
json_data = json.dumps(ostdata)
print(json_data)
r = requests.post("https://support.vh-solutions.de/api/http.php/tickets.json", data=json_data, headers=headers)
# IF request FAILED error-Message