~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/pulldown_subj/__init__.py

  • Committer: William Grant
  • Date: 2009-12-07 04:01:30 UTC
  • Revision ID: grantw@unimelb.edu.au-20091207040130-g86nvbxnm7xdaye7
Move the year decision responsibility to each pulldown module, not the pulldown framework.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
            return result
47
47
    return []
48
48
 
49
 
def enrol_user(config, store, user, year=None):
 
49
def enrol_user(config, store, user):
50
50
    """
51
51
    Looks up the student in whatever modules are available.
52
52
    The pulldown does not tell us what year to enrol the student for, so the
62
62
    Returns the number of subjects the user was enrolled in (not including
63
63
    subjects outside the system, or subjects already enrolled).
64
64
    """
65
 
    if year is None:
66
 
        year = unicode(datetime.datetime.now().year)
67
 
 
68
65
    count = 0
69
 
    for subject, semester in get_subjects(config, user.login):
 
66
    for subject, year, semester in get_subjects(config, user.login):
70
67
        offering = store.find(Offering,
71
68
                              Subject.code == subject,
72
69
                              Offering.subject_id == Subject.id,