Re: [Django] #21959: widthratio templatetag fails to handle NaN ratio

2014-02-08 Thread Django
#21959: widthratio templatetag fails to handle NaN ratio
-+-
 Reporter:  rmoe |Owner:  Aymeric
 Type:  Bug  |  Augustin 
Component:  Template system  |   Status:  closed
 Severity:  Normal   |  Version:  master
 Keywords:   |   Resolution:  fixed
Has patch:  1| Triage Stage:  Accepted
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by Aymeric Augustin ):

 * status:  new => closed
 * owner:   => Aymeric Augustin 
 * resolution:   => fixed


Comment:

 In [changeset:"07ae47f7f8b5d5f80238ea3018163cad12917852"]:
 {{{
 #!CommitTicketReference repository=""
 revision="07ae47f7f8b5d5f80238ea3018163cad12917852"
 Fixed #21959 -- Handled Inf/NaN in widthratio tag.

 Thanks rmoe for the report and the patch.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.b97c3c68681778f7dba4a3707150da37%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21959: widthratio templatetag fails to handle NaN ratio

2014-02-08 Thread Django
#21959: widthratio templatetag fails to handle NaN ratio
-+
 Reporter:  rmoe |Owner:
 Type:  Bug  |   Status:  new
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by aaugustin):

 * stage:  Unreviewed => Accepted


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.80cae0056d3d23531008cb0d9b7f66fe%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21959: widthratio templatetag fails to handle NaN ratio

2014-02-06 Thread Django
#21959: widthratio templatetag fails to handle NaN ratio
-+--
 Reporter:  rmoe |Owner:
 Type:  Bug  |   Status:  new
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by rmoe):

 You just need to call widthratio with float('inf') as both the value and
 max_value. like so:


 {{{
 {% widthratio 'inf' 'inf' 100 %}
 }}}

 Which will raise this (because ratio is NaN and can't be converted to an
 integer):


 {{{
 ValueError at /project/
 cannot convert float NaN to integer

 Request Method: GET
 Django Version: 1.5.4
 Exception Type: ValueError
 Exception Value: cannot convert float NaN to integer
 Exception Location: /usr/lib/python2.7/dist-
 packages/django/template/defaulttags.py in render, line 467
 }}}




 For some additional context, this was encountered in the Horizon component
 of the OpenStack project.
 
https://github.com/openstack/horizon/blob/master/horizon/templates/horizon/common/_limit_summary.html#L6

 When disabling quotas in the Nova component (the data it's trying to build
 the pie charts for) all quota values are set to -1 which equates to an
 infinite quota. So in the case where quotas are disabled
 usage.limits.totalInstancesUsed and usage.limits.maxTotalInstances are
 both float('inf'). This breaks the project overview page because of the
 exception raised from the widthratio templatetag.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.2868368f4d86922e9d30a13707cb5738%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21959: widthratio templatetag fails to handle NaN ratio

2014-02-05 Thread Django
#21959: widthratio templatetag fails to handle NaN ratio
-+--
 Reporter:  rmoe |Owner:
 Type:  Bug  |   Status:  new
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by jwiel86):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Hi, thanks for reporting.  Do you mind giving more information on how to
 reproduce this exception so a newbie could partake?  Thanks!

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.01f08dd3c884267dbe425bb9352fb15c%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.