Sfoglia il codice sorgente

Merge pull request #305 from untitaker/database-props

Don't discard PROPPATCH on empty collections.
Guillaume Ayoub 10 anni fa
parent
commit
f112a9b390
1 ha cambiato i file con 3 aggiunte e 5 eliminazioni
  1. 3 5
      radicale/storage/database.py

+ 3 - 5
radicale/storage/database.py

@@ -243,14 +243,12 @@ class Collection(ical.Collection):
         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 or '',
+                                  collection_path=self.path)
                 self.session.add(prop)
 
     @property