diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-05-02 01:31:56 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-05-02 01:31:56 +0000 |
| commit | f69cf70ed813a8cd7e1f963a14ae39103e8d5265 (patch) | |
| tree | d3b32e84cd66573b3833ddf662af020f8ef2f7a8 /django/bin | |
| parent | d5dbeaa9be359a4c794885c2e9f1b5a7e5e51fb8 (diff) | |
MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly backwards-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/bin')
| -rw-r--r-- | django/bin/daily_cleanup.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/django/bin/daily_cleanup.py b/django/bin/daily_cleanup.py index 52e2ef43fd..6eb5c17feb 100644 --- a/django/bin/daily_cleanup.py +++ b/django/bin/daily_cleanup.py @@ -1,17 +1,17 @@ "Daily cleanup file" -from django.core.db import db +from django.db import backend, connection, transaction DOCUMENTATION_DIRECTORY = '/home/html/documentation/' def clean_up(): # Clean up old database records - cursor = db.cursor() + cursor = connection.cursor() cursor.execute("DELETE FROM %s WHERE %s < NOW()" % \ - (db.quote_name('core_sessions'), db.quote_name('expire_date'))) + (backend.quote_name('core_sessions'), backend.quote_name('expire_date'))) cursor.execute("DELETE FROM %s WHERE %s < NOW() - INTERVAL '1 week'" % \ - (db.quote_name('registration_challenges'), db.quote_name('request_date'))) - db.commit() + (backend.quote_name('registration_challenges'), backend.quote_name('request_date'))) + transaction.commit_unless_managed() if __name__ == "__main__": clean_up() |
