mirror of
https://github.com/simple-login/app.git
synced 2024-09-29 21:21:29 +02:00
PR comment fixes
This commit is contained in:
parent
8120128a51
commit
700856053a
@ -27,7 +27,7 @@ def show_support_dialog():
|
|||||||
|
|
||||||
def check_zendesk_response_status(response_code: int) -> bool:
|
def check_zendesk_response_status(response_code: int) -> bool:
|
||||||
if response_code != 201:
|
if response_code != 201:
|
||||||
if response_code in (401 or 422):
|
if response_code in (401, 422):
|
||||||
LOG.error("Could not authenticate")
|
LOG.error("Could not authenticate")
|
||||||
else:
|
else:
|
||||||
LOG.error("Problem with the request. Status {}".format(response_code))
|
LOG.error("Problem with the request. Status {}".format(response_code))
|
||||||
@ -91,13 +91,13 @@ def create_zendesk_request(email: str, content: str, files: [FileStorage]) -> bo
|
|||||||
def process_support_dialog():
|
def process_support_dialog():
|
||||||
if not ZENDESK_HOST:
|
if not ZENDESK_HOST:
|
||||||
return render_template("dashboard/support_disabled.html")
|
return render_template("dashboard/support_disabled.html")
|
||||||
content = request.form.get("ticket_content") or ""
|
content = request.form.get("ticket_content")
|
||||||
email = request.form.get("ticket_email") or ""
|
email = request.form.get("ticket_email")
|
||||||
if not content:
|
if not content:
|
||||||
flash("Please add a description", "warning")
|
flash("Please add a description", "error")
|
||||||
return render_template("dashboard/support.html", ticket_email=email)
|
return render_template("dashboard/support.html", ticket_email=email)
|
||||||
if not email:
|
if not email:
|
||||||
flash("Please add an email", "warning")
|
flash("Please add an email", "error")
|
||||||
return render_template("dashboard/support.html", ticket_content=content)
|
return render_template("dashboard/support.html", ticket_content=content)
|
||||||
if not create_zendesk_request(
|
if not create_zendesk_request(
|
||||||
email, content, request.files.getlist("ticket_files")
|
email, content, request.files.getlist("ticket_files")
|
||||||
|
Loading…
Reference in New Issue
Block a user