Changeset 9498


Ignore:
Timestamp:
1 Nov 2012, 15:41:38 (12 years ago)
Author:
Henrik Bettermann
Message:

Emergency fix so that student who entered a wrong year can view and edit their form.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/widgets/datewidget.py

    r8193 r9498  
    127127    def _toFormValue(self, value):
    128128        if value:
    129             value = value.strftime(self.date_format)
     129            try:
     130                value = value.strftime(self.date_format)
     131            except ValueError:
     132                return value
    130133        return value
    131134
     
    168171                tz = utils.tzinfo
    169172            content = to_timezone(content, tz)
    170         content = content.strftime(self.date_format)
     173        try:
     174            content = content.strftime(self.date_format)
     175        except ValueError:
     176            return None
    171177        return renderElement("span", contents=escape(content),
    172178                             cssClass=self.cssClass)
Note: See TracChangeset for help on using the changeset viewer.