fritzy/SleekXMPP — Issue #148: load duplicate in set_backend
Author: leopay
Created: 2012-02-24 15:25:14+00:00
State: open

in roster/single.py

def set_backend(self, db=None):
"""
Set the datastore interface object for the roster node.

Arguments:
db -- The new datastore interface.
"""
self.db = db
for jid in self.db.entries(self.jid):
self.add(jid) # init the RosterItem call the self.load
# because we call `self.add` firstly, then self._jids would include all the jid
for jid in self._jids:
self._jids[jid].set_backend(db) # call Rosteritem self.load duplicate

should be

def set_backend(self, db=None):
"""
Set the datastore interface object for the roster node.

Arguments:
db -- The new datastore interface.
"""
self.db = db
for jid in self._jids:
self._jids[jid].set_backend(db)
for jid in self.db.entries(self.jid):
self.add(jid)