def canonize_duedate(duedate):
    if duedate == None:
        return '000000'
    else:
        try:
            return duedate.strftime('%y%m%d')
        except __HOLE__:
            raise DueDateFormatException("Invalid type for canonize_duedate")
dataset/ETHPy150Open kapsiry/sikteeri/membership/reference_numbers.py/canonize_duedate