mirror of
https://codeberg.org/angestoepselt/homepage.git
synced 2026-08-04 19:15:48 +00:00
Added form_category to the ticket payload if existing
This resolves #203.
This commit is contained in:
parent
16b3366cb0
commit
175bb24653
1 changed files with 22 additions and 17 deletions
|
|
@ -345,12 +345,8 @@ try:
|
||||||
assert isinstance(customer_id, (str, int))
|
assert isinstance(customer_id, (str, int))
|
||||||
|
|
||||||
# Add the actual ticket to the system.
|
# Add the actual ticket to the system.
|
||||||
response = session.post(
|
|
||||||
urljoin(ZAMMAD_URL, "api/v1/tickets"),
|
ticket_payload=dict(
|
||||||
headers={
|
|
||||||
"From": contact_email,
|
|
||||||
},
|
|
||||||
json=dict(
|
|
||||||
title=f"Kontaktformular {contact_name} – {form_name}",
|
title=f"Kontaktformular {contact_name} – {form_name}",
|
||||||
group=form_group,
|
group=form_group,
|
||||||
customer_id=customer_id,
|
customer_id=customer_id,
|
||||||
|
|
@ -366,7 +362,16 @@ try:
|
||||||
"mime-type": mimetypes.guess_type(attachment[0])[0] or "text/plain",
|
"mime-type": mimetypes.guess_type(attachment[0])[0] or "text/plain",
|
||||||
}],
|
}],
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
|
if form_category:
|
||||||
|
ticket_payload["category"] = form_category
|
||||||
|
|
||||||
|
response = session.post(
|
||||||
|
urljoin(ZAMMAD_URL, "api/v1/tickets"),
|
||||||
|
headers={
|
||||||
|
"From": contact_email,
|
||||||
|
},
|
||||||
|
json=ticket_payload,
|
||||||
)
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
ticket_id = response.json()["id"]
|
ticket_id = response.json()["id"]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue