So, the specific problem is in Bug.has_patches (lp.bugs.models.bug:447), which loops over all a bug's attachments in python to determine whether any of them are patches or not.
The short-term fix for this is to remove the call to has_patches from BugTaskImageDisplayAPI.badges() (in canonical.launchpad.webapp.tales) so that this loop is never called. In order to be able to re-enable it we should has_patches either:
a. Use a Storm query to fetch the patches for the bug or
b. Become a field in the DB updated by a trigger.
Option a seems to me to be the preferable one. I'll try to write something suitable. If I can't, I'll just remove the call from BugTaskImageDisplayAPI.badges() as detailed above.
So, the specific problem is in Bug.has_patches (lp.bugs. models. bug:447) , which loops over all a bug's attachments in python to determine whether any of them are patches or not.
The short-term fix for this is to remove the call to has_patches from BugTaskImageDis playAPI. badges( ) (in canonical. launchpad. webapp. tales) so that this loop is never called. In order to be able to re-enable it we should has_patches either:
a. Use a Storm query to fetch the patches for the bug or
b. Become a field in the DB updated by a trigger.
Option a seems to me to be the preferable one. I'll try to write something suitable. If I can't, I'll just remove the call from BugTaskImageDis playAPI. badges( ) as detailed above.