Merge 0.2.22 bugfix release updates, update copyright year in license, specify python 3.6 or above in setup

This commit is contained in:
Garret Wassermann
2020-07-30 04:46:15 -04:00
17 changed files with 2390 additions and 1642 deletions

View File

@@ -1334,8 +1334,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)