Remove a workaround which was used in the 2.0 and 2.1 Report
objects, to structure object_refs type requirements as an empty blacklist, instead of a whitelist. I think it was originally necessary due to the older implementation of ReferenceProperty which was in place at the time. With the implementation change to invert whitelists with generics to blacklists when allow_custom=True, a "full" whitelist is internally converted to an empty blacklist anyway, so it winds up being the same thing. But I think the full whitelist looks better in the code, so I prefer that to the empty blacklist.pull/1/head
parent
0ddf0d2ca8
commit
e735b537c7
|
@ -240,7 +240,7 @@ class Report(_DomainObject):
|
|||
('name', StringProperty(required=True)),
|
||||
('description', StringProperty()),
|
||||
('published', TimestampProperty(required=True)),
|
||||
('object_refs', ListProperty(ReferenceProperty(invalid_types=[], spec_version='2.0'), required=True)),
|
||||
('object_refs', ListProperty(ReferenceProperty(valid_types=["SCO", "SDO", "SRO"], spec_version='2.0'), required=True)),
|
||||
('revoked', BooleanProperty(default=lambda: False)),
|
||||
('labels', ListProperty(OpenVocabProperty(REPORT_LABEL), required=True)),
|
||||
('external_references', ListProperty(ExternalReference)),
|
||||
|
|
|
@ -644,7 +644,7 @@ class Report(_DomainObject):
|
|||
('description', StringProperty()),
|
||||
('report_types', ListProperty(OpenVocabProperty(REPORT_TYPE))),
|
||||
('published', TimestampProperty(required=True)),
|
||||
('object_refs', ListProperty(ReferenceProperty(invalid_types=[], spec_version='2.1'), required=True)),
|
||||
('object_refs', ListProperty(ReferenceProperty(valid_types=["SCO", "SDO", "SRO"], spec_version='2.1'), required=True)),
|
||||
('revoked', BooleanProperty(default=lambda: False)),
|
||||
('labels', ListProperty(StringProperty)),
|
||||
('confidence', IntegerProperty()),
|
||||
|
|
Loading…
Reference in New Issue