Skip to content

fix(ep_approval): Fix error handling, add test for single record flow - #917

Open
sakshamarora1 wants to merge 1 commit into
CERNDocumentServer:masterfrom
sakshamarora1:fix/ep_approval
Open

fix(ep_approval): Fix error handling, add test for single record flow#917
sakshamarora1 wants to merge 1 commit into
CERNDocumentServer:masterfrom
sakshamarora1:fix/ep_approval

Conversation

@sakshamarora1

Copy link
Copy Markdown
Contributor

Fixes: #912
Also makes the code ready for the migration script: https://gitlab.cern.ch/cds-team/production_scripts/-/merge_requests/59
Related: #908

if incoming_apprn != stored_apprn:
error_msg = _(
"The 'apprn' identifier is system-managed and cannot be "
"The EP approval report number is system-managed and cannot be "

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we cannot hardcode the EP label as we would like to have this configurable. Maybe we added a label fro this in the config.

Comment on lines +208 to +211
if approved_internal == source_internal:
return record["id"] == source_internal
# Public copy: source points back to a different (internal) record, always sync
return True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isnt this always True?

return False
# Migrated case: both flags point at the same version, so only the current version carries apprn
if approved_internal == source_internal:
return record["id"] == source_internal

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, that wil regenerate the apprn only for the accepted version. The truth is that all the newer versions should have the apprn number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Manually added Approval report number vanishes when admin saves

3 participants