From: Bryan Date: Fri, 20 Feb 2015 01:48:06 +0000 (-0500) Subject: removing obsolete management call to upload notes to S3 X-Git-Tag: release-20150325~18 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=996d253436fc8b3b8944c9068f6381fafa7450b8;p=oweals%2Fkarmaworld.git removing obsolete management call to upload notes to S3 --- diff --git a/karmaworld/apps/notes/management/commands/populate_s3.py b/karmaworld/apps/notes/management/commands/populate_s3.py deleted file mode 100644 index 9cc204f..0000000 --- a/karmaworld/apps/notes/management/commands/populate_s3.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python -# -*- coding:utf8 -*- -# Copyright (C) 2013 FinalsClub Foundation - -# This file is only temporary as Note.html data gets moved onto S3. -# Once Note.html no longer exists, this function should be removed. - -import hashlib -from cStringIO import StringIO - -from django.core.files.storage import default_storage -from django.core.management.base import BaseCommand -from karmaworld.apps.notes.models import Note -from karmaworld.apps.notes import sanitizer - -class Command(BaseCommand): - args = 'none' - help = """ - Upload Note.html to the S3 system. - """ - - def handle(self, *args, **kwargs): - for note in Note.objects.iterator(): - if note.static_html: - # don't reprocess notes that are already on S3. - print "Skipping pre-uploaded {0}".format(str(note)) - continue - - # grab the html from inside the note and process it - html = sanitizer.sanitize_html(note.html, note.get_canonical_url()) - html = sanitizer.sanitizer.set_canonical_rel(note.get_canonical_url()) - # push clean HTML to S3 - note.send_to_s3(html)