diff options
author | 2010-08-22 11:13:33 +0300 | |
---|---|---|
committer | 2010-08-22 11:13:33 +0300 | |
commit | bbcde4a3a4bd411f143e49cf7205061360cd3e8b (patch) | |
tree | 9cad7c4bdd7523090df794b73ad440a3bbb7335f /utils/qa_check_developer.py | |
parent | Clean up request_context hacks in tests (diff) | |
download | gsoc2010-grumpy-bbcde4a3a4bd411f143e49cf7205061360cd3e8b.tar.gz gsoc2010-grumpy-bbcde4a3a4bd411f143e49cf7205061360cd3e8b.tar.bz2 gsoc2010-grumpy-bbcde4a3a4bd411f143e49cf7205061360cd3e8b.zip |
Clean up request_context hacks in utils
Diffstat (limited to 'utils/qa_check_developer.py')
-rw-r--r-- | utils/qa_check_developer.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/utils/qa_check_developer.py b/utils/qa_check_developer.py index e31f533..cd0b436 100644 --- a/utils/qa_check_developer.py +++ b/utils/qa_check_developer.py @@ -60,21 +60,21 @@ if __name__ == '__main__': devs = download_and_parse_devs() b0rks = [] timestamp = datetime.now() - with app.test_request_context(): - # Load configuration - app.config.from_pyfile(args[0]) - # Fetch list of developers from db - dbdevs = [d.email for d in Developer.query.filter( \ - Developer.email.like('%@gentoo.org')).all()] - for dev in dbdevs: - if dev in devs: - devs.remove(dev) - else: - b0rks.append(dev) - insert_issues(b0rks) - # Clean up issues < timestamp - gc_collect(timestamp) - # Update settings and add info about last run.. - Setting.query.filter_by(name=PLUGIN_NAME).delete(False) - db.session.add(Setting(PLUGIN_NAME, str(timestamp))) - db.session.commit() + app.test_request_context().push() + # Load configuration + app.config.from_pyfile(args[0]) + # Fetch list of developers from db + dbdevs = [d.email for d in Developer.query.filter( \ + Developer.email.like('%@gentoo.org')).all()] + for dev in dbdevs: + if dev in devs: + devs.remove(dev) + else: + b0rks.append(dev) + insert_issues(b0rks) + # Clean up issues < timestamp + gc_collect(timestamp) + # Update settings and add info about last run.. + Setting.query.filter_by(name=PLUGIN_NAME).delete(False) + db.session.add(Setting(PLUGIN_NAME, str(timestamp))) + db.session.commit() |