** Summary changed:

- utils.calculate_cloud can leave font_size unset for most frequent tag
+ utils.calculate_cloud() can leave font_size unset for most frequent tag

** Description changed:

  Binary package hint: python-django-tagging
  
- This is a long standing issue on Google Code, issue 91:
+ Current version of package ``python-django-tagging'' has a long standing
+ bug in a _calculate_tag_weight() method.
  
- http://code.google.com/p/django-tagging/issues/detail?id=91
+ When a programmer creates tag cloud using method util.calculate_cloud()
+ or Tag.objects.cloud_for_model() and sets distribution argument to
+ ``LOGARITHMIC'' (or leave it empty as it is default value)
+ _calculate_tag_weight() in some cases may return result which is greater
+ than max_weight - because of that Tag object (the one most frequently
+ used in model) will be missing argument ``font_size'' and throw
+ AttributeError exception. It happens because of the way a floating point
+ division is done in Python.
  
- This issue has been reported on Google Code quite some time ago, and
- although there has been a patch available for well over a year, the
- patch just doesn't seem to get applied.  Without this patch, many
- websites written in Django will often crash when generating a tag cloud,
- because the font_size field does not always get set, and this does seem
- to happen quite a lot.
+ The proposed patch address this issue by returning ``max_weight'' in
+ case when result of computation is greater than it.
  
- I am not sure why this patch has not been applied for so long, maybe the
- upstream author will need to be contacted about this.
+ I'm attaching a testcase in a form of a django project.  To use it you
+ must install python-django-tagging and then from project root execute
+ ``./manage.py test''. AssertionError will be thrown. After fixing this
+ issue test passes.
  
- I have created a package myself with this patch applied in my own PPA
- should anyone need it for the time being:
- 
- https://launchpad.net/~robvdl/+archive/ppa
+ A link to upstream bugreport: http://code.google.com/p/django-
+ tagging/issues/detail?id=91

** Attachment added: "testcase_367214.tgz"
   http://launchpadlibrarian.net/26012610/testcase_367214.tgz

-- 
utils.calculate_cloud() can leave font_size unset for most frequent tag
https://bugs.launchpad.net/bugs/367214
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to