diff --git a/pmg/models/resources.py b/pmg/models/resources.py index a4f3df82..c2d5a0bc 100644 --- a/pmg/models/resources.py +++ b/pmg/models/resources.py @@ -187,7 +187,10 @@ def latest_version_for_indexing(self): if not version: # don't return None return [] - return base64.encodestring(version.file.get_bytes()) + try: + return base64.encodestring(version.file.get_bytes()) + except AttributeError as e: + return [] def to_dict(self, include_related=False): tmp = serializers.model_to_dict(self, include_related=include_related)