remove email from admins contact form

This commit is contained in:
christopher morris 2022-09-20 00:46:17 -07:00 committed by Ben Rog-Wilhelm
parent 0889d71647
commit 37396d42b5
2 changed files with 1 additions and 10 deletions

View file

@ -295,14 +295,11 @@ def contact(v):
@auth_required
def submit_contact(v):
body = request.values.get("message")
email = request.values.get("email")
if not body: abort(400)
if not email: email = None
header = "This message has been sent automatically to all admins via [/contact](/contact)\n"
email = f"<strong>Email</strong>: {email}\n"
message = f"<strong>Message</strong>:\n{body}\n\n"
html = sanitize(f"{header}\n{email}\n{message}")
html = sanitize(f"{header}\n{message}")
if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1":
file=request.files["file"]

View file

@ -23,12 +23,6 @@
<p>Use this form to contact {{SITE_TITLE}} Admins.</p>
<form id="contactform" action="/send_admin" method="post" enctype="multipart/form-data">
<label class="mt-3">Your Email</label>
{% if v and v.email %}
<input autocomplete="off" class="form-control" name="email" value="{{v.email}}" placeholder="(optional)">
{% else %}
<input autocomplete="off" class="form-control" name="email" value="" placeholder="(optional)">
{% endif %}
<label for="input-message" class="mt-3">Your message</label>
<input type="hidden" name="formkey" value="{{v.formkey}}">
<textarea autocomplete="off" maxlength="10000" id="input-message" form="contactform" name="message" class="form-control" required></textarea>