Comment 0 for bug 926164

Revision history for this message
Lars Butler (lars-butler) wrote : bin/openquake and engine.py: Associated the current user with a calculation and outputs

Currently, there is 1 user in the database (in the oq_user table): 'openquake'

- When a calculation is run, get the current username (using getpass.getuser(): http://docs.python.org/library/getpass.html#getpass.getuser)
- If the user does not exist, create an oq_user record for that username
- If it already exists, great; do nothing
- Get the OqUser Django model object for the user record
- This is user should be the owner all subsequent oq_job_profile, oq_calculation, and output records.