Skip to content

Commit

Permalink
Don't discard PROPPATCH on empty collections.
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed Aug 21, 2015
1 parent ce9fd74 commit 213cb40
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions radicale/storage/database.py
Expand Up @@ -243,14 +243,12 @@ def props(self):
old_properties = properties.copy()
yield properties
# On exit
if self._db_collection and old_properties != properties:
if old_properties != properties:
for prop in db_properties:
self.session.delete(prop)
for name, value in properties.items():
prop = DBProperty()
prop.name = name
prop.value = value
prop.collection_path = self.path
prop = DBProperty(name=name, value=value,
collection_path=self.path)
self.session.add(prop)

@property
Expand Down

0 comments on commit 213cb40

Please sign in to comment.