Ignore:
Timestamp:
16 Apr 2012, 20:56:59 (13 years ago)
Author:
Henrik Bettermann
Message:

Part 1: Add tzinfo to all persistent datetime objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/payments/payment.py

    r7811 r8182  
    2222from datetime import datetime
    2323from grok import index
     24from zope.component import getUtility
     25from waeup.kofa.interfaces import IKofaUtils
    2426from waeup.kofa.payments.interfaces import (
    2527    IPayment, ISCPayment, IOnlinePayment,
     
    3638    def __init__(self):
    3739        super(Payment, self).__init__()
    38         self.creation_date = datetime.now()
     40        try:
     41            tz = getUtility(IKofaUtils).tzinfo
     42        except:
     43            #In unit tests KofaUtils is not available.
     44            tz = None
     45        self.creation_date = datetime.now(tz)
    3946        self.p_id = None
    4047        return
Note: See TracChangeset for help on using the changeset viewer.