~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-01-20 00:58:53 UTC
  • mto: This revision was merged to the branch mainline in revision 1090.
  • Revision ID: grantw@unimelb.edu.au-20090120005853-s6uyy950m4oeaukl
ivle.pulldown_subj.enrol_user: Actually allow year to be None, and set it
    to the current year if it is.
bin/ivle-enrolallusers: Don't override the year if none is specified;
    enrol_user does that for us.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
import os
30
30
import sys
 
31
import datetime
31
32
 
32
33
from subjecterror import SubjectError
33
34
import ivle.conf
62
63
    Returns the number of subjects the user was enrolled in (not including
63
64
    subjects outside the system, or subjects already enrolled).
64
65
    """
 
66
    if year is None:
 
67
        year = unicode(datetime.datetime.now().year)
 
68
 
65
69
    count = 0
66
70
    for subject, semester in get_subjects(user.login):
67
71
        offering = store.find(Offering,