Comment 2 for bug 322135

Revision history for this message
Gavin Panella (allenap) wrote :

As a work around you could do:

    >>> for peertask in bugtask.related_tasks:
    ... if peertask.bug_target_display_name.endswith("(Ubuntu)"):
    ... continue
    ... dump_launchpad_object(peertask)
    ... if len(peertask.bug.bug_watches) > 0:
    ... print "Has a bug watch"

That only tells you if the bug has a watch; it may not be associated
with this particular bug task. If you need to know that, try:

    >>> for peertask in bugtask.related_tasks:
    ... if peertask.bug_target_display_name.endswith("(Ubuntu)"):
    ... continue
    ... dump_launchpad_object(peertask)
    ... # Don't do this!
    ... watch_link = task._wadl_resource.representation['bug_watch_link']
    ... if watch_link is not None:
    ... print "Has a bug watch"

That's ugly and nasty, but it should work for now. I don't know of any
plans to change the internals of launchpadlib, but it /could/ change
at any moment, so don't forget to revert any hack when the fix is
released.