Skip to content

Commit

Permalink
Merge pull request #2223 from DOAJ/feature/3371_ableist_terms
Browse files Browse the repository at this point in the history
Remove ableist terms
  • Loading branch information
Steven-Eardley committed Mar 28, 2023
2 parents 2c7e024 + e8e3f7e commit 12822f1
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 2 deletions.
4 changes: 2 additions & 2 deletions portality/forms/application_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,8 @@ class FieldDefinitions:
"options": [
{"display": "Editorial review", "value": "Editorial review"},
{"display": "Peer review", "value": "Peer review"},
{"display": "Blind peer review", "value": "Blind peer review"},
{"display": "Double blind peer review", "value": "Double blind peer review"},
{"display": "Anonymous peer review", "value": "Anonymous peer review"},
{"display": "Double anonymous peer review", "value": "Double anonymous peer review"},
{"display": "Post-publication peer review", "value": "Post-publication peer review"},
{"display": "Open peer review", "value": "Open peer review"},
{"display": "Other", "value": "other", "subfields": ["review_process_other"]}
Expand Down
13 changes: 13 additions & 0 deletions portality/migrate/3371_blind_to_anonymous/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 20 03 2023; Issue 3371 - Remove Ableist Terms

This migration changes the ableist terms present in our models

This migration changes all occurance of "Blind peer review" and "Double blind peer review" values of editorial process
field and changes it into "Anonymous peer review" and "Double anonymous peer review" accordingly


## Execution

Run the migration with

python portality/upgrade.py -u portality/migrate/3371_blind_to_anonymous/migrate.json
Empty file.
20 changes: 20 additions & 0 deletions portality/migrate/3371_blind_to_anonymous/migrate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"types": [
{
"type" : "application",
"init_with_model" : true,
"keepalive" : "1m",
"functions" : [
"portality.migrate.3371_blind_to_anonymous.operations.blind_to_anonymous_review"
]
},
{
"type": "journal",
"init_with_model": true,
"keepalive": "1m",
"functions" : [
"portality.migrate.3371_blind_to_anonymous.operations.blind_to_anonymous_review"
]
}
]
}
10 changes: 10 additions & 0 deletions portality/migrate/3371_blind_to_anonymous/operations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def blind_to_anonymous_review(obj):
bib = obj.bibjson()
processes = bib.editorial_review_process
if "Blind peer review" in processes:
bib.remove_editorial_review_process("Blind peer review")
bib.add_editorial_review_process("Anonymous peer review")
if "Double blind peer review" in processes:
bib.remove_editorial_review_process("Double blind peer review")
bib.add_editorial_review_process("Double anonymous peer review")
return obj
3 changes: 3 additions & 0 deletions portality/models/v2/bibjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ def set_editorial_review(self, process, review_url, board_url=None):
def add_editorial_review_process(self, process):
self.__seamless__.add_to_list_with_struct("editorial.review_process", process)

def remove_editorial_review_process(self, process):
self.__seamless__.delete_from_list("editorial.review_process", process)

@property
def editorial_review_process(self):
return self.__seamless__.get_list("editorial.review_process")
Expand Down

0 comments on commit 12822f1

Please sign in to comment.