~syst3mw0rm/mailman/bug-890675

« back to all changes in this revision

Viewing changes to src/mailman/model/mailinglist.py

  • Committer: Barry Warsaw
  • Date: 2012-01-27 21:21:43 UTC
  • Revision ID: barry@list.org-20120127212143-xwuw1u3ceaqwle4a
Storm now has a "load hook" which we can use to restore the rosters when the
MailingList is loaded from the database.  We need to call this explicitly in
the constructor, but at least nothing else will ever need to call it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
200
200
        self.mail_host = hostname
201
201
        # For the pending database
202
202
        self.next_request_id = 1
203
 
        self._restore()
 
203
        # We need to set up the rosters.  Normally, this method will get
 
204
        # called when the MailingList object is loaded from the database, but
 
205
        # that's not the case when the constructor is called.  So, set up the
 
206
        # rosters explicitly.
 
207
        self.__storm_loaded__()
204
208
        self.personalize = Personalization.none
205
209
        self.real_name = string.capwords(
206
210
            SPACE.join(listname.split(UNDERSCORE)))
207
211
        makedirs(self.data_path)
208
212
 
209
 
    # XXX FIXME
210
 
    def _restore(self):
 
213
    def __storm_loaded__(self):
211
214
        self.owners = roster.OwnerRoster(self)
212
215
        self.moderators = roster.ModeratorRoster(self)
213
216
        self.administrators = roster.AdministratorRoster(self)