diff --git a/fosspay/blueprints/html.py b/fosspay/blueprints/html.py index 6b3c672..ac6e01d 100644 --- a/fosspay/blueprints/html.py +++ b/fosspay/blueprints/html.py @@ -33,7 +33,8 @@ def index(): selected_project = None active_recurring = (Donation.query .filter(Donation.type == DonationType.monthly) - .filter(Donation.active == True)) + .filter(Donation.active == True) + .filter(Donation.hidden == False)) recurring_count = active_recurring.count() recurring_sum = sum([d.amount for d in active_recurring]) diff --git a/fosspay/objects.py b/fosspay/objects.py index 7deec81..562ff4d 100644 --- a/fosspay/objects.py +++ b/fosspay/objects.py @@ -27,7 +27,8 @@ class User(Base): stripe_customer = Column(String(256)) def set_password(self, password): - self.password = bcrypt.hashpw(password.encode("utf-8"), bcrypt.gensalt()).decode("utf-8") + self.password = bcrypt.hashpw(password.encode("utf-8"), + bcrypt.gensalt()).decode("utf-8") def __init__(self, email, password): self.email = email @@ -63,6 +64,7 @@ class Donation(Base): comment = Column(String(512)) active = Column(Boolean) payments = Column(Integer) + hidden = Column(Boolean, server_default='f', nullable=False) def __init__(self, user, type, amount, project=None, comment=None): self.user = user