Permalink
Browse files

fixed small typos preventing publish_everything from working

  • Loading branch information...
1 parent a3db676 commit deaf8f76e741f4e56c11d6dd1383e209b063d9da @ksclarke ksclarke committed Mar 9, 2012
Showing with 8 additions and 6 deletions.
  1. +2 −2 jobs/management/commands/publish_everything.py
  2. +6 −4 miner.py
@@ -2,13 +2,13 @@
from django.core.management.base import BaseCommand
-from shortimer.job.models import Job
+from shortimer.jobs.models import Job
class Command(BaseCommand):
def handle(self, *args, **options):
for job in Job.objects.all():
if not job.published:
- job.published = datetime.datetime.now()
+ job.published = datetime.now()
job.save()
View
@@ -80,10 +80,12 @@ def normalize_name(name):
return name
def get_html(text):
- html = "<p>" + text + "</p>"
- html = html.replace("\n\n", "</p>\n\n<p>")
- html = re.sub(URL_PATTERN, r'<a href="\1">\1</a>', html)
- return html
+ if text is not None:
+ html = "<p>" + text + "</p>"
+ html = html.replace("\n\n", "</p>\n\n<p>")
+ return re.sub(URL_PATTERN, r'<a href="\1">\1</a>', html)
+ else:
+ return None
def get_body(msg):
# pull out first text part to a multipart message

0 comments on commit deaf8f7

Please sign in to comment.