From c8b13e2710bb057c0d996733e988506119221655 Mon Sep 17 00:00:00 2001 From: Seth Woodworth Date: Tue, 27 Aug 2013 09:35:35 -0400 Subject: [PATCH] whitespacebot --- karmaworld/apps/notes/gdrive.py | 1 + karmaworld/apps/notes/models.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/karmaworld/apps/notes/gdrive.py b/karmaworld/apps/notes/gdrive.py index a89ef7b..f122447 100644 --- a/karmaworld/apps/notes/gdrive.py +++ b/karmaworld/apps/notes/gdrive.py @@ -88,6 +88,7 @@ def download_from_gdrive(file_dict, http, extension): """ get urls from file_dict and download contextual files from google """ download_urls = {} download_urls['text'] = file_dict[u'exportLinks']['text/plain'] + if extension.lower() in ['.ppt', 'pptx']: download_urls['pdf'] = file_dict[u'exportLinks']['application/pdf'] else: diff --git a/karmaworld/apps/notes/models.py b/karmaworld/apps/notes/models.py index 2aa6600..dc57494 100644 --- a/karmaworld/apps/notes/models.py +++ b/karmaworld/apps/notes/models.py @@ -43,7 +43,7 @@ class Note(models.Model): name = models.CharField(max_length=255, blank=True, null=True) slug = models.SlugField(max_length=255, null=True) - year = models.IntegerField(blank=True, null=True, + year = models.IntegerField(blank=True, null=True, default=datetime.datetime.utcnow().year) desc = models.TextField(max_length=511, blank=True, null=True) uploaded_at = models.DateTimeField(null=True, default=datetime.datetime.utcnow) @@ -120,7 +120,7 @@ class Note(models.Model): return u"/{0}/{1}/{2}".format(self.course.school.slug, self.course.slug, self.id) def sanitize_html(self, save=True): - """ if self contains html, find all tags and add target=_blank + """ if self contains html, find all tags and add target=_blank takes self returns True/False on succ/fail and error or count """ -- 2.25.1