~sircmpwn/fosspay

b1d3d5de779aef6bdbe6676c5d1023b117d7f687 — Drew DeVault 2 years ago ad84d50
Misc fixes
2 files changed, 7 insertions(+), 12 deletions(-)

M fosspay/blueprints/html.py
M fosspay/email.py
M fosspay/blueprints/html.py => fosspay/blueprints/html.py +2 -2
@@ 105,7 105,7 @@ def index():
    else:
        gh_count = 0
        gh_sum = 0
        gh_user = 0
        gh_user = None

    return render_template("index.html", projects=projects,
            avatar=avatar, selected_project=selected_project,


@@ 136,7 136,7 @@ def admin():
    first = request.args.get("first-run") is not None
    projects = Project.query.all()
    unspecified = Donation.query.filter(Donation.project == None).all()
    donations = Donation.query.order_by(Donation.created.desc()).limit(50).all()
    donations = Donation.query.order_by(Donation.created.desc()).all()
    return render_template("admin.html",
        first=first,
        projects=projects,

M fosspay/email.py => fosspay/email.py +5 -10
@@ 15,9 15,8 @@ from fosspay.currency import currency
def send_thank_you(user, amount, monthly):
    if _cfg("smtp-host") == "":
        return
    smtp = smtplib.SMTP(_cfg("smtp-host"), _cfgi("smtp-port"))
    smtp = smtplib.SMTP_SSL(_cfg("smtp-host"), _cfgi("smtp-port"))
    smtp.ehlo()
    smtp.starttls()
    smtp.login(_cfg("smtp-user"), _cfg("smtp-password"))
    with open("emails/thank-you") as f:
        tmpl = Template(f.read())


@@ 38,9 37,8 @@ def send_thank_you(user, amount, monthly):
def send_password_reset(user):
    if _cfg("smtp-host") == "":
        return
    smtp = smtplib.SMTP(_cfg("smtp-host"), _cfgi("smtp-port"))
    smtp = smtplib.SMTP_SSL(_cfg("smtp-host"), _cfgi("smtp-port"))
    smtp.ehlo()
    smtp.starttls()
    smtp.login(_cfg("smtp-user"), _cfg("smtp-password"))
    with open("emails/reset-password") as f:
        tmpl = Template(f.read())


@@ 60,9 58,8 @@ def send_password_reset(user):
def send_declined(user, amount):
    if _cfg("smtp-host") == "":
        return
    smtp = smtplib.SMTP(_cfg("smtp-host"), _cfgi("smtp-port"))
    smtp = smtplib.SMTP_SSL(_cfg("smtp-host"), _cfgi("smtp-port"))
    smtp.ehlo()
    smtp.starttls()
    smtp.login(_cfg("smtp-user"), _cfg("smtp-password"))
    with open("emails/declined") as f:
        tmpl = Template(f.read())


@@ 81,9 78,8 @@ def send_declined(user, amount):
def send_new_donation(user, donation):
    if _cfg("smtp-host") == "":
        return
    smtp = smtplib.SMTP(_cfg("smtp-host"), _cfgi("smtp-port"))
    smtp = smtplib.SMTP_SSL(_cfg("smtp-host"), _cfgi("smtp-port"))
    smtp.ehlo()
    smtp.starttls()
    smtp.login(_cfg("smtp-user"), _cfg("smtp-password"))
    with open("emails/new_donation") as f:
        tmpl = Template(f.read())


@@ 106,9 102,8 @@ def send_new_donation(user, donation):
def send_cancellation_notice(user, donation):
    if _cfg("smtp-host") == "":
        return
    smtp = smtplib.SMTP(_cfg("smtp-host"), _cfgi("smtp-port"))
    smtp = smtplib.SMTP_SSL(_cfg("smtp-host"), _cfgi("smtp-port"))
    smtp.ehlo()
    smtp.starttls()
    smtp.login(_cfg("smtp-user"), _cfg("smtp-password"))
    with open("emails/cancelled") as f:
        tmpl = Template(f.read())