Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#5286 neighborhood_blog_posts macro should ignore bad markup

forge-dec-14
closed
None
General
1
2012-12-03
2012-11-13
Rich Bowen
No

The neighborhood_blog_posts macro, eg on https://sourceforge.net/p/test-wiki/All%20project%20news/ , should ignore blog posts that contain bad markup, or perhaps just provide a link to the post, rather than having the entire macro fail.

Related

Tickets: #5402

Discussion

  • Dave Brondsema
    Dave Brondsema
    2012-11-13

    Problem is tools that no longer exist:

      File "/var/local/allura/Allura/allura/lib/macro.py", line 112, in neighborhood_blog_posts
        for post in posts if security.has_access(post, 'read', project=post.app.project)() and
      File "/var/local/allura/Allura/allura/lib/macro.py", line 112, in <genexpr>
        for post in posts if security.has_access(post, 'read', project=post.app.project)() and
      File "/var/local/env-allura/lib/python2.7/site-packages/Ming-0.3.2dev_20121101-py2.7.egg/ming/utils.py", line 18, in __get__
        result = obj.__dict__[self.__name__] = self._func(obj)
      File "/var/local/allura/Allura/allura/model/artifact.py", line 189, in app
        if getattr(c, 'app', None) and c.app.config._id == self.app_config._id:
    AttributeError: 'NoneType' object has no attribute '_id'
    
     
  • forge:tv/5286

    On master you can repro the error by installing a Blog tool, publishing a post, deleting the config for the blog tool document from mongo, then using the neighborhood_blog_posts macro.

    The new code will just skip orphaned posts instead of causing an error.

     


Anonymous


Cancel   Add attachments