Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

Commit d83cd2a

Browse files
Some changes made that caused the app to crash
1 parent 50d99a3 commit d83cd2a

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed
240 Bytes
Binary file not shown.

Profile/models.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@ class RecentEarnings(models.Model):
8585
def __str__(self) -> str:
8686
return f"{self.user.first_name} earned {self.point_earned} through {self.way_to_earn}"
8787

88-
def save(self, *args, **kwargs):
89-
# Call the original save method to create the new entry
90-
super(RecentEarnings, self).save(*args, **kwargs)
91-
92-
# Get the number of records exceeding 10 and delete them
93-
excess_records = RecentEarnings.objects.filter(user=self.user).order_by('-created_at')[10:]
94-
excess_records.delete()
9588

9689
class Referral(models.Model):
9790
user = models.OneToOneField(Profile, on_delete=models.CASCADE)

0 commit comments

Comments
 (0)