Merge pull request #1010 from simple-login/fix-upgrade

do not show upgrade button for lifetime user
This commit is contained in:
Son Nguyen Kim 2022-05-20 15:16:38 +02:00 committed by GitHub
commit a90e880b24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -640,6 +640,9 @@ class User(Base, ModelMixin, UserMixin, PasswordOracle):
return False return False
def should_show_upgrade_button(self): def should_show_upgrade_button(self):
if self.lifetime:
return False
if self.lifetime_or_active_subscription(): if self.lifetime_or_active_subscription():
# user who has canceled can also re-subscribe # user who has canceled can also re-subscribe
sub: Subscription = self.get_subscription() sub: Subscription = self.get_subscription()