City-of-Helsinki / helerm

Helsinki Electronic Records Management Classification System
MIT License
3 stars 7 forks source link

Check _attribute_validations in record.py #129

Closed Ta1Nur closed 7 years ago

Ta1Nur commented 7 years ago

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'

Ta1Nur commented 7 years ago

Found more issues with conditionally_required attributes. Will do some testing.

Ta1Nur commented 7 years ago

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'
    ),
Ta1Nur commented 7 years ago

Yes, that other issue is in UI and this correction is enough in back end. Thanks.