Skip to content

Commit

Permalink
hotfix purchase
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Feb 26, 2019
1 parent 5591841 commit ba9e06e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions apps/sspanel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions apps/ssserver/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ba9e06e

Please sign in to comment.