#4260 Clicking first commit in a repo throws a 500

v1.0.0
closed
nobody
v2 (44)
General
nobody
2015-08-20
2012-05-22
No

I was looking at the tree view of a repo on a sandbox, and happened to click on the repo's first commit. URL is like:

https://sf.net/p/project/code/ci/995544c6bb2ae8633081d460d64b8c0513ed1a95/

Traceback:

File '/home/tvansteenburgh/tvansteenburgh-6014/forge/Allura/allura/templates/repo/commit.html', line 1 in top-level template code               
  {% extends 'allura:templates/repo/repo_master.html' %}
File '/home/tvansteenburgh/tvansteenburgh-6014/forge/Allura/allura/templates/repo/repo_master.html', line 61 in top-level template code
  <span class="scm-tag-label">{{t}}</span>
File '/home/tvansteenburgh/tvansteenburgh-6014/forge/Allura/allura/templates/jinja_master/master.html', line 96 in top-level template code
  {% block content %}{% endblock %}
File '/home/tvansteenburgh/tvansteenburgh-6014/forge/Allura/allura/templates/repo/commit.html', line 36 in block "content"
  <a class="commit-diff-link" href="{{commit.url()}}tree{{h.really_unicode(file)}}?diff={{prev[0].object_id}}">Diff</a>
File '/var/local/env-allura/lib/python2.7/site-packages/Jinja2-2.6-py2.7.egg/jinja2/environment.py', line 372 in getattr
  return getattr(obj, attribute)
UndefinedError: list object has no element 0

For added or changed types, looks like we need to check that prev[0] actually exists first. Same for the javascript on line 56.

Discussion

  • Dave Brondsema

    Dave Brondsema - 2012-07-13
    • status: open --> closed
    • milestone: forge-backlog --> forge-jul-13
     
  • Dave Brondsema

    Dave Brondsema - 2012-07-13

    This was fixed in the big SCM merge.

     

Log in to post a comment.