Commit 28701dcf authored by 段英荣's avatar 段英荣

modify complaint bug

parent 4c633b87
...@@ -107,11 +107,14 @@ class Topic(models.Model): ...@@ -107,11 +107,14 @@ class Topic(models.Model):
@property @property
def is_complaint(self): def is_complaint(self):
"""是否被举报""" """是否被举报"""
try:
if TopicComplaint.objects.filter(topic_id=self.id, is_online=True).exists():
return True
if TopicComplaint.objects.filter(topic_id=self.id, is_online=True).exists(): return False
return True except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return False return False
def topic_has_image(self): def topic_has_image(self):
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment