Closed Ta1Nur closed 7 years ago
Found more issues with conditionally_required attributes. Will do some testing.
In # Record attribute validation rules, hardcoded at least for now Yes this needs to be fixed - like this included also 'Restriction.SecurityPeriodStart'
_attribute_validations = {
'allowed': (
'AdditionalInformation', 'DataGroup', 'DisposePreviousVersions', 'InformationSystem', 'PersonalData',
'PublicityClass', 'PublicityClassChange', 'RecordType', 'Restriction.ProtectionLevel',
'Restriction.SecurityClass', 'RetentionPeriod', 'RetentionPeriodStart', 'RetentionPeriodTotal',
'RetentionPeriodOffice', 'RetentionReason', 'ProtectionClass', 'SecurityPeriod', 'Restriction.SecurityPeriodStart', 'SocialSecurityNumber',
'StorageAccountable', 'StorageOrder', 'Subject.Scheme', 'Subject', 'TypeSpecifier'
),
Yes, that other issue is in UI and this correction is enough in back end. Thanks.
Issue helerm-ui dont show 'Restriction.SecurityPeriodStart' in record editing form
Found potential reason for that in _attribute_validations https://github.com/City-of-Helsinki/helerm/blob/master/metarecord/models/record.py 'conditionally_required' attribute needs to be listed also in 'allowed'
This conlusion is based on https://github.com/City-of-Helsinki/helerm/blob/master/metarecord/models/function.py Function edit form works correctly with 'Restriction.SecurityPeriodStart' when 'conditionally_required' attribute is also in 'allowed'