summaryrefslogtreecommitdiff
path: root/django/bin/daily_cleanup.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/bin/daily_cleanup.py')
-rw-r--r--django/bin/daily_cleanup.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/django/bin/daily_cleanup.py b/django/bin/daily_cleanup.py
index 6f2e8da4c0..52e2ef43fd 100644
--- a/django/bin/daily_cleanup.py
+++ b/django/bin/daily_cleanup.py
@@ -7,8 +7,10 @@ DOCUMENTATION_DIRECTORY = '/home/html/documentation/'
def clean_up():
# Clean up old database records
cursor = db.cursor()
- cursor.execute("DELETE FROM core_sessions WHERE expire_date < NOW()")
- cursor.execute("DELETE FROM registration_challenges WHERE request_date < NOW() - INTERVAL '1 week'")
+ cursor.execute("DELETE FROM %s WHERE %s < NOW()" % \
+ (db.quote_name('core_sessions'), db.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()
if __name__ == "__main__":