Add notification

This commit is contained in:
cuom1999 2020-07-02 21:50:31 -05:00
parent ab59065c0b
commit de704fc250
17 changed files with 279 additions and 56 deletions

View file

@ -125,6 +125,14 @@ class Profile(models.Model):
def username(self):
return self.user.username
@cached_property
def count_unseen_notifications(self):
query = {
'read': False,
'comment__hidden': False,
}
return self.notifications.filter(**query).count()
_pp_table = [pow(settings.DMOJ_PP_STEP, i) for i in range(settings.DMOJ_PP_ENTRIES)]
def calculate_points(self, table=_pp_table):