Ignore:
Timestamp:
18 Nov 2015, 07:34:56 (9 years ago)
Author:
Henrik Bettermann
Message:

Catch TypeError?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/browser.py

    r13387 r13472  
    169169            return _("Payment ticket can't be re-sent to CollegePAY.")
    170170        tz = getUtility(IKofaUtils).tzinfo
    171         time_delta = datetime.utcnow() - self.context.creation_date
     171        try:
     172            time_delta = datetime.utcnow() - self.context.creation_date
     173        except TypeError:
     174            # when importing datetimes we are storing offset-aware datetimes
     175            # which causes a TypeError
     176            now = datetime.now(tz)
     177            time_delta = datetime.now(tz) - self.context.creation_date
    172178        if time_delta.days > 7:
    173179            return _("This payment ticket is too old. Please create a new ticket.")
Note: See TracChangeset for help on using the changeset viewer.