core: improve performances on notification reads and display

This commit is contained in:
2019-09-09 00:45:08 +02:00
parent eb9821ed36
commit f1b3a174b6
3 changed files with 24 additions and 2 deletions

View File

@ -1393,7 +1393,7 @@ class Notification(models.Model):
_("type"), max_length=32, choices=settings.SITH_NOTIFICATIONS, default="GENERIC"
)
date = models.DateTimeField(_("date"), default=timezone.now)
viewed = models.BooleanField(_("viewed"), default=False)
viewed = models.BooleanField(_("viewed"), default=False, db_index=True)
def __str__(self):
if self.param: