Skip to content

Commit

Permalink
Merge pull request #544 from tangoalx/develop
Browse files Browse the repository at this point in the history
overwrite doc defaults by cli defaults
  • Loading branch information
jacebrowning committed Feb 13, 2022
2 parents 0643d69 + bd64e78 commit 86f2b48
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doorstop/core/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,14 @@ def add_item(self, number=None, level=None, reorder=True, defaults=None, name=No
more_defaults = self._load_with_include(defaults) if defaults else None

item = Item.new(self.tree, self, self.path, self.root, uid, level=next_level)
if self._attribute_defaults:
item.set_attributes(self._attribute_defaults)

# exclusivity: apply defaults given by command line OR
# document based defaults, but not both
if more_defaults:
item.set_attributes(more_defaults)
elif self._attribute_defaults:
item.set_attributes(self._attribute_defaults)

if level and reorder:
self.reorder(keep=item)
return item
Expand Down

0 comments on commit 86f2b48

Please sign in to comment.