From d961b2b69282c9707b3741556af829a3a3366eeb Mon Sep 17 00:00:00 2001 From: bbe Date: Mon, 29 Jun 2020 14:38:41 +0200 Subject: [PATCH] Fix KnowledgeBase item score --- helpdesk/models.py | 3 ++- helpdesk/templates/helpdesk/kb_item.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/helpdesk/models.py b/helpdesk/models.py index 177574ce..a8f649cd 100644 --- a/helpdesk/models.py +++ b/helpdesk/models.py @@ -1031,8 +1031,9 @@ class KBItem(models.Model): return super(KBItem, self).save(*args, **kwargs) def _score(self): + """ Return a score out of 10 or Unrated if no votes """ if self.votes > 0: - return int(self.recommendations / self.votes) + return (self.recommendations / self.votes) * 10 else: return _('Unrated') score = property(_score) diff --git a/helpdesk/templates/helpdesk/kb_item.html b/helpdesk/templates/helpdesk/kb_item.html index e48007fa..fa4e85fb 100644 --- a/helpdesk/templates/helpdesk/kb_item.html +++ b/helpdesk/templates/helpdesk/kb_item.html @@ -29,7 +29,7 @@