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

« back to all changes in this revision

Viewing changes to bin/ivle-enrolallusers

  • Committer: William Grant
  • Date: 2009-05-13 03:15:26 UTC
  • mto: This revision was merged to the branch mainline in revision 1247.
  • Revision ID: grantw@unimelb.edu.au-20090513031526-l3knlkpgnldp6dgj
Attempting to view an SVN log when the repo is empty will not crash now.

svnlogservice now returns a 404 if the revision isn't found.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
    print >> sys.stderr, "%s must be run as root" % sys.argv[0]
56
56
    sys.exit(1)
57
57
 
58
 
config = ivle.config.Config()
59
 
store = ivle.database.get_store(config)
60
 
 
 
58
store = ivle.database.get_store(ivle.config.Config())
61
59
if options.user is None:
62
60
    users = store.find(ivle.database.User).order_by(ivle.database.User.login)
63
61
else:
78
76
    try:
79
77
        # Get all subjects this user is enrolled in, and add them to the DB if
80
78
        # they match one of our local subject codes
81
 
        res = ivle.pulldown_subj.enrol_user(config, store, user, options.year)
 
79
        res = ivle.pulldown_subj.enrol_user(store, user, options.year)
82
80
        logging.info("Enrolled user %s in %d subject%s." % (user.login, res,
83
81
                        '' if res == 1 else 's'))
84
82
    except Exception, message: