pedagogy: display if comment is reported

This commit is contained in:
2019-06-20 15:03:51 +02:00
parent 55e822412a
commit 75a2aefd69
2 changed files with 12 additions and 1 deletions

View File

@ -27,6 +27,7 @@ from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django.core import validators
from django.conf import settings
from django.utils.functional import cached_property
from core.models import User
@ -165,6 +166,13 @@ class UVComment(models.Model):
"""
return self.author == user or user.is_owner(self.uv)
@cached_property
def is_reported(self):
"""
Return True if someone reported this UV
"""
return self.reports.exists()
def __str__(self):
return "%s - %s" % (self.uv, self.author)