If an attempt is made to view a release (i.e., release encoding) that has an associated file that has no associated track, things break

Bug #539271 reported by Chris Wagner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Resonate
Fix Committed
High
Unassigned

Bug Description

Why should a release have a file with an unassociated track? Well, I don't think it should -- there is currently a bug in the collection-librarian that leads to this scenario -- but it would be good if we can handle this situation anyway, at least without raising a stack trace. We should probably handle it by simple leaving out any files without an associated track.

Here's an example stack trace...

Traceback (most recent call last):

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/actions/__init__.py", line 33, in execute_view
    return render_to_response(template, template_vars)

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/actions/__init__.py", line 77, in render_to_response
    return HttpResponseOkay(render_template(template, template_vars))

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/lib/templates.py", line 14, in render_template
    return _get_template_env().get_template(template_name).render(**data). \

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/templates/members/release.tpl", line 2, in top-level template code
    {% extends "members/base.tpl" %}

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/templates/members/base.tpl", line 2, in top-level template code
    {% extends "base.tpl" %}

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/templates/base.tpl", line 2, in top-level template code
    {% extends "bare-base.tpl" %}

  File "/home/chrisw/app-data/easyweaze/ui/templates/bare-base.tpl", line 41, in top-level template code
    {% block body %}

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/templates/base.tpl", line 7, in block "body"
    {% block body_container %}

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/templates/members/base.tpl", line 88, in block "body_container"
    {% block content %}

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/templates/members/release.tpl", line 65, in block "content"
    {% for f in release.default_encoding.get_sorted_files() %} <tr>

  File "/home/chrisw/lib/python2.5/jinja2/runtime.py", line 132, in call
    return __obj(*args, **kwargs)

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/models.py", line 542, in get_sorted_files
    return sorted(files, cmp=tracknum_compare)

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/models.py", line 541, in tracknum_compare
    def tracknum_compare(f1, f2): return cmp(f1.track.track_num, f2.track.track_num)

AttributeError: 'NoneType' object has no attribute 'track_num'

Changed in resonate:
status: New → Confirmed
importance: Undecided → Medium
Changed in resonate:
importance: Medium → High
summary: If an attempt is made to view a release (i.e., release encoding) that
- has an associated file that has no associated track, thnigs break
+ has an associated file that has no associated track, things break
description: updated
Revision history for this message
Chris Wagner (chris-wagner) wrote :

Fixed in revision 823.

Changed in resonate:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.