diff --git a/apps/sspanel/models.py b/apps/sspanel/models.py index 3838596817..cb03dcf3bb 100644 --- a/apps/sspanel/models.py +++ b/apps/sspanel/models.py @@ -305,7 +305,9 @@ def purchase_by_user(self, user): else: user.level_expire_time = now + days ss_user.reset_traffic(self.transfer) + ss_user.enable = True user.level = self.level + ss_user.save() user.save() # 增加购买记录 PurchaseHistory.objects.create( diff --git a/apps/ssserver/models.py b/apps/ssserver/models.py index df08aa680a..560ca05fef 100644 --- a/apps/ssserver/models.py +++ b/apps/ssserver/models.py @@ -202,11 +202,9 @@ def reset_traffic(self, new_traffic): self.transfer_enable = new_traffic self.upload_traffic = 0 self.download_traffic = 0 - self.save() def increase_transfer(self, new_transfer): self.transfer_enable += new_transfer - self.save() class Node(ExportModelOperationsMixin("node"), models.Model):