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_herd.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_herd.py')
-rw-r--r-- | utils/qa_check_herd.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/utils/qa_check_herd.py b/utils/qa_check_herd.py index b8bdf5f..33c0f9f 100644 --- a/utils/qa_check_herd.py +++ b/utils/qa_check_herd.py @@ -68,19 +68,19 @@ if __name__ == '__main__': herds = download_and_parse_herds() b0rks = [] timestamp = datetime.now() - with app.test_request_context(): - # Load configuration - app.config.from_pyfile(args[0]) - # Fetch list of herds from db - for herd in Herd.query.all(): - if herd.name in herds: - herds.remove(herd.name) - else: - b0rks.append(herd.name) - update_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 herds from db + for herd in Herd.query.all(): + if herd.name in herds: + herds.remove(herd.name) + else: + b0rks.append(herd.name) + update_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() |