Skip to content

Commit

Permalink
merge up from develop
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-jones committed Jul 28, 2023
2 parents b5505d3 + 10d5d75 commit 5b6d665
Show file tree
Hide file tree
Showing 28 changed files with 218 additions and 43 deletions.
Binary file added cms/assets/img/sponsors/oaworks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cms/assets/img/volunteers/Kadri Kiran.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cms/assets/img/volunteers/Pablo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions cms/data/sponsors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ silver:
- name: MDPI
url: https://www.mdpi.com/
logo: mdpi.svg

- name: OA.Works
url: https://oa.works/
logo: oaworks.png

- name: SAGE Publishing
url: https://www.sagepublications.com/
Expand Down Expand Up @@ -102,6 +106,10 @@ bronze:
url: https://www.keaipublishing.com/
logo: keai.svg

- name: OASPA
url: https://oaspa.org/
logo: oaspa.png

- name: OCLC
url: https://www.oclc.org/
logo: oclc.svg
Expand Down
4 changes: 2 additions & 2 deletions cms/data/team.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
- name: Iemima Ploscariu
role: Managing Editor
photo: iemima.jpeg
bio: 'Iemima holds a Master of Arts in Comparative History from Central European University, Hungary, and a Master of Letters in Central and East European Studies from the University of St Andrews, Scotland. She is a PhD student and researcher for the Irish Research Council at Dublin City University, Ireland. She volunteered as an Editor for DOAJ from 2014 until 2020 when she became a Managing Editor.'
bio: 'Iemima holds a PhD in History from Dublin City University, Ireland, as an Irish Research Council fellow. She also has an MA in Comparative History and an MLitt in Central and East European Studies. She is originally from Romania, grew up in California, and now lives in Barcelona, Spain. She volunteered as an Editor for DOAJ from 2014 until 2020 when she became a Managing Editor.'
coi:
2020: https://drive.google.com/file/d/1-4wTgvwCu_tvDv5NIoJhZi0QpQl-fpdB/view?usp=sharing
2022: https://drive.google.com/file/d/1xEUUxhqSE0OnKd_x8z1oLLRRrJrKAwXA/view?usp=sharing
Expand Down Expand Up @@ -193,7 +193,7 @@ Based in Rome and Göttingen, Ilaria loves baking cakes; she speaks Italian, Eng
2022: https://drive.google.com/file/d/19J5ELHNaV_pby7ZpQMii8_Ts4wiERu8K/view?usp=sharing

- name: Tom Olijhoek
role: Editor-in-Chief
role: Head of Outreach
photo: tom.jpg
bio: 'Tom has a PhD in molecular microbiology and spent several years in Africa doing research on malaria, sleeping sickness and meningococcal epidemics. He has been actively advocating open access and open science since 2012 when he joined the Open Knowledge community and became a member of the DOAJ advisory board. His current research interests are development of quality systems for the assessment of scholarly journals and articles, and research in the area of soil microbiology in relation to soil health and human health.'
coi:
Expand Down
24 changes: 16 additions & 8 deletions cms/data/volunteers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ ed:
featured: true
photo: "napa.jpg"

- name: Pablo Hernandez
area: Medical Sciences
year_since:
city: Caracas
country: Venezuela
language: Spanish, English
photo: "Pablo.jpg"

- name: Paola Galimberti
area: Research Evaluation
year_since:
Expand Down Expand Up @@ -456,6 +464,14 @@ ass_ed:
country:
language: Korean, English

- name: Kadri Kıran
area: Systematic Entomology
year_since:
city: Tekirdag
country: Turkey
language: English, Turkish, German
photo: "Kadri Kiran.jpg"

- name: Kâmil B. Varınca
area: Science
year_since:
Expand Down Expand Up @@ -687,14 +703,6 @@ ass_ed:
country: Spain
language: Euskera, Spanish, English

- name: Pablo Hernandez
area: Science
year_since:
city: Caracas
country: Venezuela
language: Spanish, English
photo: "pablohernandez.jpg"

- name: Paula Carina de Araújo
area: Library and Information Science
year_since:
Expand Down
3 changes: 3 additions & 0 deletions cms/pages/about/at-20.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ Find out more by [registering with us](https://forms.reform.app/S49aj6/DOAJat20/
You can also follow and join our celebration on social media: #DOAJat20 ([Mastodon](https://masto.ai/tags/DOAJat20) & [Twitter](https://twitter.com/search?q=%23DOAJat20)).

## Support our anniversary campaign

<iframe src="https://www.paypal.com/giving/campaigns?campaign_id=4VXR4TJ69MDJJ" title="PayPal donate campaign card" frameborder="0" width=382 height=550 scrolling="no" ></iframe>

As a crucial open infrastructure, DOAJ relies on donations from supporting organisations to help keep it running to provide the services the community relies on and trusts.

We're running [a fundraising campaign](https://www.paypal.com/giving/campaigns?campaign_id=4VXR4TJ69MDJJ) for our 20th year.
Expand Down
16 changes: 9 additions & 7 deletions cms/pages/about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ OPEN - DOAJ is a vital part of the global open access infrastructure.

GLOBAL – DOAJ is a global community, with [team members](/about/team/), [ambassadors](/about/ambassadors/) and [volunteers](/about/volunteers/) based in 45 countries around the world, speaking 36 languages.

TRUSTED – Globally DOAJ's [standards](/apply/guide/#basic-criteria-for-inclusion) have become a gold standard for open access publishing.
TRUSTED – Globally, DOAJ's [criteria](/apply/guide/#basic-criteria-for-inclusion) have become a gold standard for open access publishing.

## Our mission

Expand All @@ -30,7 +30,7 @@ DOAJ works to build an equitable and diverse scholarly ecosystem where trusted r

DOAJ is an independent, non-profit organisation managed by [Infrastructure Services for Open Access C.I.C.](https://is4oa.org/) (IS4OA), a [community interest company](https://en.wikipedia.org/wiki/Community_interest_company) registered in the United Kingdom and with a branch in Denmark.

DOAJ relies entirely on the voluntary donations of its supporters. Neither DOAJ or IS4OA receive grants or funding from any other source.
DOAJ relies entirely on the voluntary donations of its supporters. Neither DOAJ nor IS4OA receive grants or funding from any other source.

DOAJ has an [Advisory Board and Council](/about/advisory-board-council), the members of which carry out their duties voluntarily.

Expand All @@ -51,19 +51,19 @@ We expect the members of our Team, our volunteers and our Ambassadors to always

## Partnerships and collaborations

DOAJ partners with many organisations. The nature of the partnerships vary and may include membership, contracts for work, exchanges of information or services, initiative signatories, or access to information resources that assist DOAJ with our application review process.
DOAJ partners with many organisations. The nature of the partnerships varies and may include membership, contracts for work, exchanges of information or services, initiative signatories, or access to information resources that assist DOAJ with our application review process.

{:.stretch-list}
+ [Creative Commons Global Network](https://network.creativecommons.org/)
{:.stretch-list__item}
{:.stretch-list__item}
+ [Crossref](https://crossref.org/)
{:.stretch-list__item}
+ [COPE](https://publicationethics.org/)
{:.stretch-list__item}
+ [Cottage Labs LLP](https://cottagelabs.com/)
{:.stretch-list__item}
+ [DOAB (Directory of Open Access Books)](https://www.doabooks.org/)
{:.stretch-list__item}
+ [Federation of Finnish Learned Societies](https://tsv.fi/en)
{:.stretch-list__item}
+ [Helsinki Initiative on Multilingualism](https://www.helsinki-initiative.org/)
{:.stretch-list__item}
+ [ISSN](https://www.issn.org/)
Expand All @@ -73,7 +73,9 @@ DOAJ partners with many organisations. The nature of the partnerships vary and m
+ [OASPA](https://oaspa.org/)
{:.stretch-list__item}
+ [OCLC](https://www.oclc.org/en/home.html)
{:.stretch-list__item}
{:.stretch-list__item}
+ [OpenAIRE](https://www.openaire.eu/)
{:.stretch-list__item}
+ [Redalyc](https://www.redalyc.org/)
{:.stretch-list__item}
+ [Research4Life](https://www.research4life.org/)
Expand Down
2 changes: 1 addition & 1 deletion cms/pages/apply/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sticky_sidenav: true
featuremap: ~~GuideToApplying:Fragment~~

---
Before you start the application process, you will be asked to log in or register. You will be able to save your progress and review all your answers before you submit them. A [PDF version of the application form](/static/doaj/docs/2022-09-27-DOAJQuestions.pdf) is available for reference only.
Before you start the application process, you will be asked to log in or register. You will be able to save your progress and review all your answers before you submit them. A [PDF version of the application form](/static/doaj/docs/2023-07-04-DOAJQuestions.pdf) is available for reference only.

## Basic criteria for inclusion

Expand Down
14 changes: 11 additions & 3 deletions cms/pages/legal/terms.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,16 @@ DOAJ uses a variety of licenses for the different parts of its website and the c

---

### Licensing terms for content published on DOAJ News Service
15. DOAJ News Service is the DOAJ blog, hosted on Wordpress: https://blog.doaj.org

16. All content posted on the blog is licensed under the CC BY-NC Creative Commons license. See the blog footer for full details.

---

### Version history
1. **Version 1.3** (20 April 2023) - address and contact details added to Copyright (1). 'Other than as permitted in law...' added to Copyright (2). Notice period added to Conditions of using this website (3). Conditions of using this website (4) rewritten completely to make it clearer that the name and website are protected.
2. **Version 1.2** (20 January 2022) - corrected ownership from DOAJ to IS4OA in Copyright (1). Simplified the language of Copyright (3). Corrected ownership from DOAJ to IS4OA in Conditions of using this website (4)
3. **Version 1** (March 2021)
1. **Version 1.4** (03 July 2023) - added details about the way we license content on our blog, DOAJ News Service.
2. **Version 1.3** (20 April 2023) - address and contact details added to Copyright (1). 'Other than as permitted in law...' added to Copyright (2). Notice period added to Conditions of using this website (3). Conditions of using this website (4) rewritten completely to make it clearer that the name and website are protected.
3. **Version 1.2** (20 January 2022) - corrected ownership from DOAJ to IS4OA in Copyright (1). Simplified the language of Copyright (3). Corrected ownership from DOAJ to IS4OA in Conditions of using this website (4)
4. **Version 1** (March 2021)

Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ tests:
- step: Add author's ORCID iD in the wrong format eg "0000-0000-0000-000a"
- step: Click "Add Article" button
results:
- 'Red error message: ''Invalid ORCID iD. Please enter your ORCID iD as a full
URL of the form https://orcid.org/0000-0000-0000-0000'''
- 'Red error message: ''Invalid ORCID iD. Please enter your ORCID iD structured as: https://orcid.org/0000-0000-0000-0000. URLs must start with https.'''
- step: Enter valid Orcid iD for one of the authors
- step: 'Enter valid Full-Text URL, eg: https://pl.wikipedia.org/wiki/Torun'
- step: Select ISSN print and online version from dropdowns
Expand Down
67 changes: 67 additions & 0 deletions doajtest/unit/api_tests/test_apiv3_crud_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,3 +915,70 @@ def test_18_applications_currency_validator(self):
data=json.dumps(data))
assert resp.status_code == 400, resp.status_code
assert resp.json['error'].startswith("Field 'title' is required but not present at '[root]bibjson.'")

def test_19_applications_language_validator(self):
""" Ensure we get the correct validation messages via the API """
account = models.Account()
account.set_id("test")
account.set_name("Tester")
account.set_email("[email protected]")
account.set_role(["publisher", "api"])
api_key = account.generate_api_key()
account.save(blocking=True)

data = ApplicationFixtureFactory.incoming_application()

# Invalid language error comes from the model
data['bibjson']['language'][0] = 'mumbling quietly'
with self.assertRaises(Api400Error) as e2:
ApplicationsCrudApi.create(data, account=account)
assert str(e2.exception).startswith("Coerce with '<function to_isolang.")

# If you make a new application via tha API route a bad currency is caught by the model too:
with self.app_test.test_request_context():
with self.app_test.test_client() as t_client:
resp = t_client.post(url_for('api_v3.create_application') + f'?api_key={api_key}',
data=json.dumps(data))
assert resp.status_code == 400, resp.status_code
assert resp.json['error'].startswith("Coerce with '<function to_isolang.")

# But an outgoing application with the same problem is ok (we can read but not write these to the index)
assert data['bibjson']['language'][0] == 'mumbling quietly'
out_A = OutgoingApplication(data)
assert out_A.verify_against_struct() is None # None means there's no verification errors

# An application already in the index can only be updated with a valid currency by API
grandfathered_app = ApplicationFixtureFactory.make_application_source()
del grandfathered_app['admin']['current_journal']
del grandfathered_app['admin']['related_journal']
grandfathered_app['admin']['application_type'] = 'new_application'
grandfathered_app['bibjson']['language'][0] = 'an old language we dont recognise'
grandfathered_app['admin']['owner'] = account.id
appl = models.Application(**grandfathered_app)
appl_id = appl.id
appl.save(blocking=True)

with self.app_test.test_request_context():
with self.app_test.test_client() as t_client:
resp = t_client.get(url_for('api_v3.retrieve_application', application_id=appl_id) + f'?api_key={api_key}',
data=json.dumps(data))
assert resp.status_code == 200, resp.status_code

retrieved_app = resp.json
assert retrieved_app['bibjson']['language'][0] == 'an old language we dont recognise'

# The same application is rejected when sent with the same invalid currency
with self.app_test.test_request_context():
with self.app_test.test_client() as t_client:
resp = t_client.put(url_for('api_v3.update_application', application_id=appl_id) + f'?api_key={api_key}',
data=json.dumps(retrieved_app))
assert resp.status_code == 400, resp.status_code
assert resp.json['error'].startswith("Coerce with '<function to_isolang.")

# Updated currency is fine
retrieved_app['bibjson']['language'][0] = 'EN'
with self.app_test.test_request_context():
with self.app_test.test_client() as t_client:
resp = t_client.put(url_for('api_v3.update_application', application_id=appl_id) + f'?api_key={api_key}',
data=json.dumps(retrieved_app))
assert resp.status_code == 204, resp.status_code
14 changes: 14 additions & 0 deletions doajtest/unit/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,20 @@ def test_37_currency_code_lax(self):
a2 = models.Application(**asource)
assert a2.bibjson().apc.pop() == {'currency': 'bananas', 'price': 2}

def test_38_language_lax(self):
""" Check we can open a journal / application model with an invalid currency but can't save it """
asource = ApplicationFixtureFactory.make_application_source()

# FARSI exists in the index as legacy data, but we usually accept it as Persian. It's supposed to be a code.
asource['bibjson']['language'] = ['FARSI']
a = models.Application(**asource)
assert a.bibjson().language_name() == ['FARSI']

# We could actually put complete nonsense in here if we wanted
asource['bibjson']['language'][0] = 'interpretive dance'
a2 = models.Application(**asource)
assert a2.bibjson().language.pop() == 'interpretive dance'


class TestAccount(DoajTestCase):
def test_get_name_safe(self):
Expand Down
4 changes: 4 additions & 0 deletions portality/api/current/data_objects/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@

"structs": {
"bibjson": {
"lists": {
# override for lax language enforcement in the core, making it strict for incoming applications
"language": {"contains": "field", "coerce": "isolang_2letter_strict"}
},
"required": [
"copyright",
"deposit_policy",
Expand Down
2 changes: 1 addition & 1 deletion portality/api/current/data_objects/article.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def custom_validate(self):
# check if orcid id is valid
for author in self.bibjson.author:
if author.orcid_id is not None and regex.ORCID_COMPILED.match(author.orcid_id) is None:
raise dataobj.DataStructureException("Invalid ORCID iD format. Please use url format, eg: https://orcid.org/0001-1111-1111-1111")
raise dataobj.DataStructureException("Invalid ORCID iD. Please enter your ORCID iD structured as: https://orcid.org/0000-0000-0000-0000. URLs must start with https.")

for x in self.bibjson.identifier:
if x.type == "doi":
Expand Down
7 changes: 4 additions & 3 deletions portality/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from portality.lib.normalise import normalise_doi
from portality.view.dashboard import blueprint as dashboard

if app.config.get("DEBUG", False):
if app.config.get("DEBUG", False) and app.config.get("TESTDRIVE_ENABLED", False):
from portality.view.testdrive import blueprint as testdrive

app.register_blueprint(account, url_prefix='/account') #~~->Account:Blueprint~~
Expand Down Expand Up @@ -78,8 +78,9 @@
app.register_blueprint(atom) # ~~-> Atom:Blueprint~~
app.register_blueprint(doaj) # ~~-> DOAJ:Blueprint~~

if app.config.get("DEBUG", False):
app.register_blueprint(testdrive, url_prefix="/testdrive") # ~~-> Testdrive:Feature ~~
if app.config.get("DEBUG", False) and app.config.get("TESTDRIVE_ENABLED", False):
app.logger.warning('Enabling TESTDRIVE at /testdrive')
app.register_blueprint(testdrive, url_prefix="/testdrive") # ~~-> Testdrive:Feature ~~

# initialise the index - don't put into if __name__ == '__main__' block,
# because that does not run if gunicorn is loading the app, as opposed
Expand Down
3 changes: 2 additions & 1 deletion portality/bll/services/background_task_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def create_queued_status(self, action, total=2, oldest=1200, **_) -> dict:
err_msgs = []
limited_oldest_date = dates.before_now(oldest)
if oldest_job and oldest_job.created_timestamp < limited_oldest_date:
err_msgs.append('outdated job found. created_timestamp[{} < {}]'.format(
err_msgs.append('outdated queued job found[{}]. created_timestamp[{} < {}]'.format(
oldest_job.id,
oldest_job.created_timestamp,
limited_oldest_date
))
Expand Down
22 changes: 17 additions & 5 deletions portality/forms/application_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
OwnerExists,
NoScriptTag,
Year,
CurrentISOCurrency
CurrentISOCurrency,
CurrentISOLanguage
)
from portality.lib import dates
from portality.lib.formulaic import Formulaic, WTFormsBuilder, FormulaicContext, FormulaicField
Expand Down Expand Up @@ -422,7 +423,8 @@ class FieldDefinitions:
"initial": 5
},
"validate": [
{"required": {"message": "Enter <strong>at least one</strong> language"}}
{"required": {"message": "Enter <strong>at least one</strong> language"}},
"current_iso_language"
],
"widgets": [
{"select": {}},
Expand Down Expand Up @@ -1366,8 +1368,7 @@ class FieldDefinitions:
{"field": "deposit_policy", "value": "other"}],
"help": {
"doaj_criteria": "You must provide a URL",
"short_help": "Link to the policy in a directory or on the "
"publisher’s site",
"short_help": "Provide the link to the policy in the selected directory. Or select 'Other' and provide a link to the information on your website.",
"placeholder": "https://www.my-journal.com/about#repository_policy"
},
"validate": [
Expand Down Expand Up @@ -2855,6 +2856,16 @@ def render(settings, html_attrs):
def wtforms(field, settings):
return CurrentISOCurrency(settings.get("message"))


class CurrentISOLanguageBuilder:
@staticmethod
def render(settings, html_attrs):
pass

@staticmethod
def wtforms(field, settings):
return CurrentISOLanguage(settings.get("message"))

#########################################################
# Crosswalks
#########################################################
Expand Down Expand Up @@ -2917,7 +2928,8 @@ def wtforms(field, settings):
"owner_exists" : OwnerExistsBuilder.wtforms,
"no_script_tag": NoScriptTagBuilder.wtforms,
"year": YearBuilder.wtforms,
"current_iso_currency": CurrentISOCurrencyBuilder.wtforms
"current_iso_currency": CurrentISOCurrencyBuilder.wtforms,
"current_iso_language": CurrentISOLanguageBuilder.wtforms
}
}
}
Expand Down
Loading

0 comments on commit 5b6d665

Please sign in to comment.