Cite corner case support in admin.
authorRadek Czajka <rczajka@rczajka.pl>
Mon, 17 Jun 2019 13:33:22 +0000 (15:33 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Mon, 17 Jun 2019 13:33:22 +0000 (15:33 +0200)
src/social/admin.py

index 0a634ed..bceb890 100755 (executable)
@@ -25,7 +25,7 @@ class CiteAdmin(admin.ModelAdmin):
     def nonempty_text(self, cite):
         if cite.text.strip():
             return cite.text
-        return "(%s)" % (cite.image_title.strip() or cite.link)
+        return "(%s)" % ((cite.image_title or '').strip() or cite.link)
     nonempty_text.short_description = _('text')
 
     def has_image(self, cite):