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

« back to all changes in this revision

Viewing changes to bin/ivle-makeuser

  • Committer: William Grant
  • Date: 2009-05-28 02:05:26 UTC
  • Revision ID: grantw@unimelb.edu.au-20090528020526-ck5nds3mh7tsh2l0
Improve tests of ivle.studpath.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    print "Must run %s as root." % os.path.basename(sys.argv[0])
36
36
    sys.exit(1)
37
37
 
 
38
from ivle.config import Config
38
39
from ivle.database import get_store, User
39
40
from ivle.pulldown_subj import enrol_user
40
41
 
80
81
if 'nick' not in user:
81
82
    user['nick'] = user['fullname']
82
83
 
83
 
store = get_store()
 
84
config = Config()
 
85
store = get_store(config)
84
86
 
85
87
try:
86
88
    # Make the user's database entry
87
89
    userobj = User(**user)
88
90
    store.add(userobj)
89
 
    enrol_user(store, userobj)
 
91
    enrol_user(config, store, userobj)
90
92
    store.commit()
91
93
except Exception, message:
92
94
    print "Error: " + str(message)