~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/browser/bugtarget.py

  • Committer: Robert Collins
  • Date: 2011-06-07 23:20:43 UTC
  • mto: This revision was merged to the branch mainline in revision 13175.
  • Revision ID: robert@canonical.com-20110607232043-hafyb84s2sy65i34
And fix tags_js_data to deal with security proxies.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1451
1451
    @property
1452
1452
    def tags_js_data(self):
1453
1453
        """Return the JSON representation of the bug tags."""
1454
 
        used_tags = self.context.getUsedBugTagsWithOpenCounts(self.user)
1455
 
        official_tags = self.context.official_bug_tags
 
1454
        # The model returns dict and list respectively but dumps blows up on
 
1455
        # security proxied objects.
 
1456
        used_tags = removeSecurityProxy(
 
1457
            self.context.getUsedBugTagsWithOpenCounts(self.user))
 
1458
        official_tags = removeSecurityProxy(self.context.official_bug_tags)
1456
1459
        return """<script type="text/javascript">
1457
1460
                      var used_bug_tags = %s;
1458
1461
                      var official_bug_tags = %s;