Fix FileSystemSource.get() to not look for the latest version of

an object when markings are queried, since markings are not
versioned.
revert-222-multi_version_filesystem_store
Michael Chisholm 2018-11-06 16:06:26 -05:00
parent 9f83f2140b
commit 7bb3d1f6a6
1 changed files with 6 additions and 1 deletions

View File

@ -529,7 +529,12 @@ class FileSystemSource(DataSource):
all_data = self.all_versions(stix_id, version=version, _composite_filters=_composite_filters)
if all_data:
stix_obj = sorted(all_data, key=lambda k: k['modified'])[-1]
if is_marking(stix_id):
# Markings are unversioned; there shouldn't be more than one
# result.
stix_obj = all_data[0]
else:
stix_obj = sorted(all_data, key=lambda k: k['modified'])[-1]
else:
stix_obj = None