unable to get milestone of a task via the API

Bug #333173 reported by Markus Korn
2
Affects Status Importance Assigned to Milestone
Launchpad itself
Invalid
Undecided
Unassigned

Bug Description

Some recent changes (in malone) made it impossible to get the milestone of a task using launchpadlib. AFAICS, that the attribute is called "milestone_link" in the json representation, but it was renamed to "milestone" in the wadl definition file.
(as a side note: as of now https://edge.launchpad.net/+apidoc/#bug_task has still the old "milestone_link")

In [1]: b = launchpad.bugs[319641]

In [2]: t = b.bug_tasks[0]

In [3]: dir(t)
Out[3]:
[...
 'milestone',
 'owner',
 ...]

In [4]: t.milestone
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)

/media/disk-1/ipython/launchpad-shell/<ipython console> in <module>()

/media/disk-1/lp_api/launnchpadlib/trunk/launchpadlib/resource.pyc in __getattr__(self, name)
    455 if name in self._dirty_attributes:
    456 return self._dirty_attributes[name]
--> 457 return super(Entry, self).__getattr__(name)
    458
    459 def __setattr__(self, name, value):

/media/disk-1/lp_api/launnchpadlib/trunk/launchpadlib/resource.pyc in __getattr__(self, attr)
    300 except KeyError:
    301 raise AttributeError("'%s' object has no attribute '%s'"
--> 302 % (self.__class__.__name__, attr))
    303
    304 def _get_external_param_name(self, param_name):

AttributeError: 'Entry' object has no attribute 'milestone'

In [5]:

Markus

Tags: lp-bugs
Revision history for this message
Markus Korn (thekorn) wrote :
Revision history for this message
Markus Korn (thekorn) wrote :
Revision history for this message
Eleanor Berger (intellectronica) wrote :

Edge was reverted to a previous revision of Launchpad at some point, and I think it's missing the relevant code, but that should be solved very soon.

Changed in malone:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.