Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions invenio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,17 @@ CDS_COMMITTEE_APPROVAL_COMMUNITIES = {
"counter_digits": 3, # zero-padding width, e.g. 3 → "001"
},
},
"1c46ceab-af68-4502-a436-cdf5a4cfbbe0": {
# isolde
"read_only": True, # only allow read-only access to this community

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.

you can add this as well to LEP experiments

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we need to add this in our openshift environments too, lets document it in CERNDocumentServer/cds-migrator-kit#600

"label": "EP approval",
"referee_group": "cds-ph-ep-publication",
"report_number": {
"prefix": "CERN-EP",
"include_year": True,
"counter_digits": 3,
},
},
}
#
# CDS_COMMITTEE_APPROVAL_COMMUNITIES = {
Expand Down
8 changes: 7 additions & 1 deletion site/cds_rdm/requests/committee_approval.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ def _resolve_community_config(request):
"CDS_COMMITTEE_APPROVAL_COMMUNITIES", {}
)
if default_community_id in committee_communities:
return committee_communities[default_community_id]
config = committee_communities[default_community_id]
if config.get("read_only"):
raise ValidationError(
"This community's approval workflow is read-only. "
"No new committee approval requests can be submitted."
)
return config
raise ValidationError(
# TODO: do we need i18n for these errors?
"The record's community is not enrolled in the committee approval workflow. "
Expand Down
26 changes: 24 additions & 2 deletions site/cds_rdm/requests/committee_approval_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,31 @@ def get_committee_approval_state(record_ui, record=None):
pass

open_request = _get_open_request(record_id, parent_record)
can_submit = _check_can_manage_community(community_id)
approved_report_number = ea.get("reportnumber")
can_create_public = _check_can_create_public(can_submit, ea, record_id)

community_read_only = community_config.get("read_only", False)
if community_read_only:
if not approved_report_number:
return {
"can_submit": False,
Comment on lines +230 to +231

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.

could you explain why this dict need to be returned in this form? Out of curiosity, I want to understand how it works

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

basically this is a UI serialization on what is needed to render the component.

"can_create_public": False,
"approval_label": _approval_label(community_config),
"committee_name": _committee_name(community_config),
"community_enrolled": False,
"is_public_approved_record": False,
"open_request": None,
"approved_report_number": None,
"approval_date": None,
"committee_approval": {},
"draft_record_id": None,
"can_view_reviewed_version": False,
"receiver_group": None,
}
can_submit = False
can_create_public = False
else:
can_submit = _check_can_manage_community(community_id)
can_create_public = _check_can_create_public(can_submit, ea, record_id)

cern_scientific_community_id = current_app.config.get(
"CDS_CERN_SCIENTIFIC_COMMUNITY_ID"
Expand Down
Loading