Ignore:
Timestamp:
28 Aug 2012, 08:13:21 (12 years ago)
Author:
Henrik Bettermann
Message:

The year_range function was only used in applicants. Extend academic session range properly.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r9047 r9115  
    1818"""Interfaces of the university application package.
    1919"""
     20from datetime import datetime
    2021from grokcore.content.interfaces import IContainer
    2122from zc.sourcefactory.contextual import BasicContextualSourceFactory
     
    2829from waeup.kofa.schema import TextLineChoice, FormattedDate
    2930from waeup.kofa.interfaces import (
    30     IKofaObject, year_range, validate_email,
     31    IKofaObject, validate_email,
    3132    SimpleKofaVocabulary)
    3233from waeup.kofa.interfaces import MessageFactory as _
     
    4041
    4142_marker = object() # a marker different from None
     43
     44def year_range():
     45    curr_year = datetime.now().year
     46    return range(curr_year - 2, curr_year + 5)
    4247
    4348class RegNumInSource(ValidationError):
  • main/waeup.kofa/trunk/src/waeup/kofa/interfaces.py

    r9114 r9115  
    6565            SimpleTerm(value, value, title) for title, value in terms])
    6666
    67 def year_range():
    68     curr_year = datetime.now().year
    69     return range(1995, curr_year + 5)
    70 
    7167def academic_sessions():
    7268    curr_year = datetime.now().year
    73     year_range = range(curr_year - 15, curr_year + 2)
     69    year_range = range(1995, curr_year + 2)
    7470    return [('%s/%s' % (year,year+1), year) for year in year_range]
    7571
Note: See TracChangeset for help on using the changeset viewer.