Merge pull request #3823 from ostcar/fix_empty_data_in_rest

fix empty values in rest
This commit is contained in:
Oskar Hahn 2018-09-01 15:13:54 +02:00 committed by GitHub
commit c3bc1487d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -284,8 +284,8 @@ class Collection(Cachable):
all_full_data = self.get_elements_from_db() all_full_data = self.get_elements_from_db()
else: else:
all_full_data = async_to_sync(element_cache.get_all_full_data)() all_full_data = async_to_sync(element_cache.get_all_full_data)()
self.full_data = all_full_data[self.collection_string] self.full_data = all_full_data.get(self.collection_string, [])
return self.full_data return self.full_data # type: ignore
def as_list_for_user(self, user: Optional[CollectionElement]) -> List[Dict[str, Any]]: def as_list_for_user(self, user: Optional[CollectionElement]) -> List[Dict[str, Any]]:
""" """