fixing whitelabel from name. Identified possible bug when reconfirming forms

This commit is contained in:
Cole 2018-09-24 21:42:48 -04:00
parent 9eb1580afa
commit 57cee01051
2 changed files with 4 additions and 2 deletions

View File

@ -315,6 +315,8 @@ def resend_confirmation(email):
# ~~~
# if there's no bounce, we proceed to resend the confirmation.
# BUG: What if this is an owned form with hashid??
form = Form.query.filter_by(hash=HASH(email, request.form['host'])).first()
if not form:
if request_wants_json():

View File

@ -138,13 +138,13 @@ def send_email(to=None, subject=None, text=None, html=None,
bracket = sender.index('<')
data.update({
'from': sender[bracket+1:-1],
'from_name': sender[:bracket].strip()
'fromname': sender[:bracket].strip()
})
except ValueError:
data.update({'from': sender})
if from_name:
data.update({'from_name': from_name})
data.update({'fromname': from_name})
if headers:
data.update({'headers': json.dumps(headers)})