~sambuddhabasu1/mailman/fix_mailman_run_error

« back to all changes in this revision

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

  • Committer: Barry Warsaw
  • Date: 2012-03-26 12:04:00 UTC
  • Revision ID: barry@list.org-20120326120400-jfezy6cg60ygod7k
Architecture
------------
 * Internally, all datetimes are kept in the UTC timezone, however because of
   LP: #280708, they are stored in the database in naive format.
 * `received_time` is now added to the message metadata by the LMTP runner
   instead of by `Switchboard.enqueue()`.  This latter no longer depends on
   `received_time` in the metadata.
 * The `ArchiveRunner` no longer acquires a lock before it calls the
   individual archiver implementations, since not all of them need a lock.  If
   they do, the implementations must acquire said lock themselves.

Configuration
-------------
 * New configuration variables `clobber_date` and `clobber_skew` supported in
   every `[archiver.<name>]` section.  These are used to determine under what
   circumstances a message destined for a specific archiver should have its
   `Date:` header clobbered.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    ]
26
26
 
27
27
 
28
 
import datetime
29
 
 
30
28
from zope.event import notify
31
29
from zope.interface import implements
32
30
 
36
34
    IListManager, ListAlreadyExistsError, ListCreatedEvent, ListCreatingEvent,
37
35
    ListDeletedEvent, ListDeletingEvent)
38
36
from mailman.model.mailinglist import MailingList
 
37
from mailman.utilities.datetime import now
39
38
 
40
39
 
41
40
 
57
56
        if mlist:
58
57
            raise ListAlreadyExistsError(fqdn_listname)
59
58
        mlist = MailingList(fqdn_listname)
60
 
        mlist.created_at = datetime.datetime.now()
 
59
        mlist.created_at = now()
61
60
        config.db.store.add(mlist)
62
61
        notify(ListCreatedEvent(mlist))
63
62
        return mlist