Misc fixes

This commit is contained in:
Drew DeVault 2021-06-24 10:41:56 -04:00
parent ad84d50ef6
commit b1d3d5de77
2 changed files with 7 additions and 12 deletions

View File

@ -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,

View File

@ -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())