collective / collective/collective.exportimport

On import DX-deserializer fails if expires is set before effective

Open
#12 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
19
Forks
20
PR merge metrics
No merged PRs in 30d

Description

In old Plone sites this is apparently no problem to set, but when we call the DX deserializer on an imported item where effective > expires, the import is aborted with a ValidationError:

orig_error is my local patch in plone.restapi to see the real message when I get dropped in to a PDB (PDBDebugMode)

```

*** zExceptions.BadRequest: [{'error': 'ValidationError',
'message': 'error_expiration_must_be_after_effective_date',
'orig_error': EffectiveAfterExpires('error_expiration_must_be_after_effective_date'),
'id': 'http://localhost:9050/plone/nl/kalender/asfasdfdsfasdf.pdf',
```

'orig_data': {'@id': 'http://localhost:9050/plone/nl/kalender/asdfasdfsdfads.pdf', '@type': 'File', 'UID': '5397b307c9cc784319fca831cb0994d9', 'allow_discussion': False, 'contributors': [], 'created': '2015-09-07T12:40:17+00:00', 'creators': ['asdfasfdf'], 'description': None, 'effective': '2015-09-07T12:40:00+00:00', 'exclude_from_nav': True, 'expires': '2014-02-01T00:00:00+00:00',
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the DX deserializer and the imported item's effective and expires fields shown in the issue. Reproduce the import using the supplied dates and inspect the ValidationError, including the reported error_expiration_must_be_after_effective_date message. Done means the intended handling of effective > expires is defined and the import behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.