diff options
Diffstat (limited to 'lib/d2/app/adapters/detail.py')
-rw-r--r-- | lib/d2/app/adapters/detail.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/d2/app/adapters/detail.py b/lib/d2/app/adapters/detail.py index 738230b..ba2906d 100644 --- a/lib/d2/app/adapters/detail.py +++ b/lib/d2/app/adapters/detail.py | |||
@@ -351,10 +351,11 @@ class DetailAdapter(BaseAdapter): | |||
351 | def details(self, plot_id=None, occupant_id=None): | 351 | def details(self, plot_id=None, occupant_id=None): |
352 | """ Returns a named tuple with complete details. | 352 | """ Returns a named tuple with complete details. |
353 | """ | 353 | """ |
354 | plot_id, occupant_id = self._validate(plot_id, occupant_id) | 354 | (plot_id_, occupant_id_) = self._validate(plot_id, occupant_id) |
355 | plot = self.details_to_dict(self.fetch_all_plot_details(plot_id)) | 355 | |
356 | plot = self.details_to_dict(self.fetch_all_plot_details(plot_id_)) | ||
356 | occupant = self.details_to_dict(self.fetch_all_occupant_details( | 357 | occupant = self.details_to_dict(self.fetch_all_occupant_details( |
357 | occupant_id)) | 358 | occupant_id_)) |
358 | 359 | ||
359 | if plot and occupant: | 360 | if plot and occupant: |
360 | occupant[u'plot_id'] = plot[u'plot_id'] | 361 | occupant[u'plot_id'] = plot[u'plot_id'] |
@@ -368,6 +369,7 @@ class DetailAdapter(BaseAdapter): | |||
368 | 369 | ||
369 | for key, val in plot.items(): | 370 | for key, val in plot.items(): |
370 | occupant[key] = val | 371 | occupant[key] = val |
372 | |||
371 | return self._details_dict_to_tuple(occupant) | 373 | return self._details_dict_to_tuple(occupant) |
372 | 374 | ||
373 | if plot: | 375 | if plot: |
@@ -376,6 +378,9 @@ class DetailAdapter(BaseAdapter): | |||
376 | if occupant: | 378 | if occupant: |
377 | return self._details_dict_to_tuple(occupant) | 379 | return self._details_dict_to_tuple(occupant) |
378 | 380 | ||
381 | make_ = namedtuple("Detail", "label plot_id occupant_id") | ||
382 | return make_(None, None, None) | ||
383 | |||
379 | def _validate(self, plot_id, occupant_id, start_date=None): | 384 | def _validate(self, plot_id, occupant_id, start_date=None): |
380 | """Validates that the given plot_id and occupant_id | 385 | """Validates that the given plot_id and occupant_id |
381 | are valid. Also checks forge | 386 | are valid. Also checks forge |