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

an object when markings are queried, since markings are not
versioned.
master
Michael Chisholm 2018-11-06 16:06:26 -05:00
parent 0cecbeb9d8
commit da13882eec
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) all_data = self.all_versions(stix_id, version=version, _composite_filters=_composite_filters)
if all_data: 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: else:
stix_obj = None stix_obj = None