Support final ohne bilder
This commit is contained in:
parent
9b67853193
commit
732744b078
|
|
@ -45,7 +45,6 @@
|
|||
<tr >
|
||||
{% for area in areas %}
|
||||
<td class="text-center" style="background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 0.3); color: #ffffff"><h4 style="color: rgba(0,0,0, 1);"><b>{{area.name}}</b></h4></td>
|
||||
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -4,7 +4,7 @@
|
|||
<div class="content-section">
|
||||
<h3>Supportanfrage stellen</h3>
|
||||
<hr>
|
||||
<form method="POST">
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{form|crispy}}
|
||||
<div class="form-group">
|
||||
|
|
|
|||
|
|
@ -107,4 +107,5 @@ class SupportForm(forms.Form):
|
|||
self.fields['name'] = forms.CharField(required=True, label="Ihr Name", initial=user_name)
|
||||
self.fields['mail'] = forms.EmailField(required=True, label="E-Mail", initial=user.email)
|
||||
self.fields['problemconc'] = forms.CharField(required=True, label="Problemzusammenfassung")
|
||||
self.fields['problem'] = forms.CharField(required=True, widget=forms.Textarea, label="Ausführliche Beschreibung")
|
||||
self.fields['problem'] = forms.CharField(required=True, widget=forms.Textarea, label="Ausführliche Beschreibung")
|
||||
self.fields['image'] = forms.ImageField()
|
||||
|
|
@ -20,6 +20,7 @@ from django.utils import formats
|
|||
from news.models import News
|
||||
import requests
|
||||
import json
|
||||
from PIL import Image
|
||||
'''
|
||||
|
||||
DASHBOARD-View
|
||||
|
|
@ -405,6 +406,7 @@ def support(request):
|
|||
|
||||
if request.method == 'POST':
|
||||
form = request.POST
|
||||
#image = request.FILES
|
||||
supportdata = dict(form)
|
||||
# Data from Form to JSON-Format
|
||||
name = str(supportdata['name'][0])
|
||||
|
|
@ -415,7 +417,12 @@ def support(request):
|
|||
# HEADERS CURL
|
||||
headers = {'X-API-Key': 'F025A238EB74914E3653BA2989BFF7C4'}
|
||||
subject = "Digitale Agentur: " + str(problemconc)
|
||||
|
||||
|
||||
#final_img = image['image']
|
||||
|
||||
#fi = Image.open(final_img)
|
||||
#print(fi)
|
||||
|
||||
# DataJSON
|
||||
ostdata = {
|
||||
"topicId" : '12',
|
||||
|
|
@ -423,13 +430,14 @@ def support(request):
|
|||
"email": mail,
|
||||
"subject": 'Digitale Agentur: '+problemconc,
|
||||
"ip": "1.1.1.1",
|
||||
"message": problem,
|
||||
"message": problem
|
||||
}
|
||||
json_data = json.dumps(ostdata)
|
||||
|
||||
r = requests.post("https://support.vh-solutions.de/api/http.php/tickets.json", data=json_data, headers=headers)
|
||||
# IF request FAILED error-Message
|
||||
if(r.status_code != 201):
|
||||
messages.warning(request, f'Supportanfrage fehlgeschlagen!')
|
||||
messages.warning(request, f'Supportanfrage fehlgeschlagen!' + str(r))
|
||||
else:
|
||||
messages.success(request, f'Supportanfrage erfolgreich! Ihre Ticketnummer ist '+ str(r.json()) +'!')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue