Changeset 16713


Ignore:
Timestamp:
15 Nov 2021, 12:47:49 (3 years ago)
Author:
Henrik Bettermann
Message:

Catch TypeError?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/student.py

    r16412 r16713  
    277277        if self.personal_updated is None:
    278278            return True
    279         days_ago = getattr(now - self.personal_updated, 'days')
     279        try:
     280            days_ago = getattr(now - self.personal_updated, 'days')
     281        except TypeError:
     282            # This happens after reimport of personal_updated because
     283            # Python  can't subtract offset-naive and offset-aware datetimes
     284            return True
    280285        if days_ago > 180:
    281286            return True
Note: See TracChangeset for help on using the changeset viewer.