aboutsummaryrefslogtreecommitdiff
path: root/tagging/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'tagging/utils.py')
-rw-r--r--tagging/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tagging/utils.py b/tagging/utils.py
index e89bab0..759e8d8 100644
--- a/tagging/utils.py
+++ b/tagging/utils.py
@@ -232,7 +232,7 @@ def _calculate_tag_weight(weight, max_weight, distribution):
if distribution == LINEAR or max_weight == 1:
return weight
elif distribution == LOGARITHMIC:
- return math.log(weight) * max_weight / math.log(max_weight)
+ return min((max_weight, math.log(weight) * max_weight / math.log(max_weight)))
raise ValueError(_('Invalid distribution algorithm specified: %s.') % distribution)
def calculate_cloud(tags, steps=4, distribution=LOGARITHMIC):