Skip to content

Commit

Permalink
Add next bill date on admin UI (#1154)
Browse files Browse the repository at this point in the history
* add subscription next bill date on admin

* small refactor: remove unused param
  • Loading branch information
nguyenkims authored Jul 12, 2022
1 parent b742f58 commit f367acb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,11 +690,11 @@ def upgrade_channel(self) -> str:
if sub:
if sub.cancelled:
channels.append(
f"Cancelled Paddle Subscription {sub.subscription_id} {sub.plan_name()}"
f"Cancelled Paddle Subscription {sub.subscription_id} {sub.plan_name()} {sub.next_bill_date}"
)
else:
channels.append(
f"Active Paddle Subscription {sub.subscription_id} {sub.plan_name()}"
f"Active Paddle Subscription {sub.subscription_id} {sub.plan_name()} {sub.next_bill_date}"
)

apple_sub: AppleSubscription = AppleSubscription.get_by(user_id=self.id)
Expand Down
6 changes: 2 additions & 4 deletions email_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,7 @@
from server import create_light_app


def get_or_create_contact(
from_header: str, mail_from: str, alias: Alias, msg: Message
) -> Contact:
def get_or_create_contact(from_header: str, mail_from: str, alias: Alias) -> Contact:
"""
contact_from_header is the RFC 2047 format FROM header
"""
Expand Down Expand Up @@ -626,7 +624,7 @@ def handle_forward(envelope, msg: Message, rcpt_to: str) -> List[Tuple[bool, str
from_header = get_header_unicode(msg[headers.FROM])
LOG.d("Create or get contact for from_header:%s", from_header)
try:
contact = get_or_create_contact(from_header, envelope.mail_from, alias, msg)
contact = get_or_create_contact(from_header, envelope.mail_from, alias)
except ObjectDeletedError:
LOG.d("maybe alias was deleted in the meantime")
alias = Alias.get_by(email=alias_address)
Expand Down

0 comments on commit f367acb

Please sign in to comment.