Fix FileSystemSource.get() to not look for the latest version of
an object when markings are queried, since markings are not versioned.master
parent
0cecbeb9d8
commit
da13882eec
|
@ -529,6 +529,11 @@ 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:
|
||||||
|
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]
|
stix_obj = sorted(all_data, key=lambda k: k['modified'])[-1]
|
||||||
else:
|
else:
|
||||||
stix_obj = None
|
stix_obj = None
|
||||||
|
|
Loading…
Reference in New Issue