Handle edge case
authorCharles Connell <charles@connells.org>
Tue, 11 Mar 2014 17:20:42 +0000 (13:20 -0400)
committerCharles Connell <charles@connells.org>
Tue, 11 Mar 2014 17:20:42 +0000 (13:20 -0400)
karmaworld/apps/notes/management/commands/populate_filepicker.py

index b8ecc8a0ec8580d08822eb7d2152677294cc52d5..dcf556c11ff23866407a000f0ad8336d96fea1dc 100644 (file)
@@ -34,8 +34,11 @@ class Command(BaseCommand):
                     print html_resp.text
                     continue
                 html = html_resp.text
-            else:
+            elif note.html:
                 html = note.html
+            else:
+                print "Couldn't find any HTML for {0}".format(str(note))
+                continue
 
             fp_policy_json = '{{"expiry": {0}, "call": ["pick","store","read","stat"]}}'
             fp_policy_json = fp_policy_json.format(int(time.time() + 31536000))