skip bogus or empty news feed items

workspace
Brendan Howell 7 years ago
parent 8930c7df33
commit 103f9b69fd

@ -230,6 +230,10 @@ class Publications(Bureau):
else: else:
entry.img = " " entry.img = " "
# skip bogus entries with no text
if not hasattr(entry, "summary"):
continue
# limit summary to the last space below 500 characters # limit summary to the last space below 500 characters
if len(entry.summary) > 500: if len(entry.summary) > 500:
end = entry.summary.rfind(" ", 0, 499) end = entry.summary.rfind(" ", 0, 499)

Loading…
Cancel
Save