Skip to content

Commit 25a825d

Browse files
committed
add sub count to profile model
1 parent 869b2e7 commit 25a825d

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

account/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class UserProfile(models.Model):
7979
major = models.TextField(null=True)
8080
language = models.TextField(null=True)
8181
# for Contest
82+
total_submissions = models.IntegerField(default=0)
8283
accepted_number = models.IntegerField(default=0)
8384
total_score = models.IntegerField(default=0)
8485

submission/views/user.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def post(self, request):
137137
assert user
138138
profile = UserProfile.objects.get(user=user)
139139
assert profile
140+
profile.total_submissions += 1
140141
if problem._id not in profile.problems_status:
141142
profile.problems_status[problem._id] = score
142143
profile.total_score += score

0 commit comments

Comments
 (0)