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

« back to all changes in this revision

Viewing changes to bin/ivle-enrolallusers

  • Committer: Matt Giuca
  • Date: 2009-02-25 03:04:08 UTC
  • mto: This revision was merged to the branch mainline in revision 1119.
  • Revision ID: matt.giuca@gmail.com-20090225030408-5e13v4felqc4aybr
(almost) all HTML pages updated: Moved <h1>s outside of the ivle-padding div.
    Added new <h1>s to pages which didn't have any, and reduced <h1s> down to
    <h2s> if they didn't represent the page heading.

h1s now represent the top-level heading of a page. The new style sheet styles
them specially, designed to appear directly underneath the tab bar. Therefore,
they need to appear outside of any padding.

util.py: Removed the <h1> from the default-generated terms of service page.
    (All other TOS pages should follow). There is now a <h1> at the top of the
    TOS template page instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
import optparse
35
35
import logging
36
36
 
37
 
import ivle.db
38
37
import ivle.database
39
38
import ivle.pulldown_subj
40
39
 
70
69
    logging.error("Year must be numeric")
71
70
    sys.exit(1)
72
71
 
 
72
options.year = unicode(options.year)
 
73
 
73
74
for user in users:
74
75
    try:
75
76
        # Get all subjects this user is enrolled in, and add them to the DB if
76
77
        # they match one of our local subject codes
77
 
        res = ivle.pulldown_subj.enrol_user(user.login, options.year)
 
78
        res = ivle.pulldown_subj.enrol_user(store, user, options.year)
78
79
        logging.info("Enrolled user %s in %d subject%s." % (user.login, res,
79
80
                        '' if res == 1 else 's'))
80
81
    except Exception, message:
81
82
        logging.warning(str(message))
82
83
        continue
83
84
    
 
85
store.commit()
84
86
logging.info("enrolment completed successfully")