Changeset 5544

Show
Ignore:
Timestamp:
10/18/08 17:44:46 (3 months ago)
Author:
lmacken
Message:

Check to see if c.paginators exists before checking its type.

This fixes a bug where the following error is thrown when the paginate
decorator tries to check the type of the paginators, when it does not yet exist.

AttributeError?: 'ContextObj?' object has no attribute 'paginators'

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tg/decorators.py

    r5526 r5544  
    322322                # I didn't find that documented, so I 
    323323                # just put this in here and hope it works. 
    324                 if type(c.paginators) == str: 
     324                if not hasattr(c, 'paginators') or type(c.paginators) == str: 
    325325                    c.paginators = Bunch() 
    326326                c.paginators[name] = page