Skip to content

Instantly share code, notes, and snippets.

@cacheleocode
Created December 17, 2014 20:31
Show Gist options
  • Select an option

  • Save cacheleocode/5911dd28daa0fc5c053d to your computer and use it in GitHub Desktop.

Select an option

Save cacheleocode/5911dd28daa0fc5c053d to your computer and use it in GitHub Desktop.
determine if article is legacy
def is_legacy(self):
is_legacy = False
temp = []
if not self.image_attachments():
if not self.image:
temp.append(False)
else:
temp.append(True)
else:
temp.append(True)
# remove duplicates
temp = list(set(temp))
# if no attachment images or key image
if len(temp) == 1 and False in temp:
is_legacy = True
return is_legacy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment