Skip to content

Commit

Permalink
Merge branch 'develop' into feature/903_remove_blanks
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Eardley committed Aug 1, 2023
2 parents b6966d9 + ec2d037 commit db655b2
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 7 deletions.
13 changes: 13 additions & 0 deletions doajtest/fixtures/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
VALID_URL_LISTS = [
"https://www.sunshine.com",
"http://www.moonlight.com",
"https://www.cosmos.com#galaxy",
"https://www.cosmos.com/galaxy",
"https://www.cosmos.com/galaxy#peanut"
]

INVALID_URL_LISTS = [
"ht:www",
"nonexistent.com",
"https://www.doaj.org and https://www.reddit.com"
]
14 changes: 12 additions & 2 deletions doajtest/unit/test_regexes.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
""" Gather and test DOAJ regexes here """

from doajtest.helpers import DoajTestCase
from doajtest.fixtures import dois, issns
from doajtest.fixtures import dois, issns, urls

from portality.regex import DOI_COMPILED, ISSN_COMPILED
from portality.regex import DOI_COMPILED, ISSN_COMPILED, HTTP_URL_COMPILED

import re

Expand Down Expand Up @@ -41,3 +41,13 @@ def test_02_ISSN_regex(self):

for x in issns.INVLAID_ISSN_LIST:
assert not issn_regex.match(x), x

def test_03_URL_regex(self):
""" Check that the URL regex performs correctly. """
url_regex = HTTP_URL_COMPILED

for i in urls.VALID_URL_LISTS:
assert url_regex.match(i), i

for x in urls.INVALID_URL_LISTS:
assert not url_regex.match(x), x
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
2 changes: 1 addition & 1 deletion portality/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
BIG_END_DATE_COMPILED = re.compile(BIG_END_DATE)

#~~URL:Regex~~
HTTP_URL = r'^https?://([^/:]+\.[a-z]{2,63}|([0-9]{1,3}\.){3}[0-9]{1,3})(:[0-9]+)?(\/.*)?$'
HTTP_URL = r'^https?://([^/:]+\.[a-z]{2,63}|([0-9]{1,3}\.){3}[0-9]{1,3})(:[0-9]+)?(\/.*)?(#.*)?$'
HTTP_URL_COMPILED = re.compile(HTTP_URL, re.IGNORECASE)


Expand Down
2 changes: 1 addition & 1 deletion portality/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Application Version information
# ~~->API:Feature~~

DOAJ_VERSION = "6.3.9"
DOAJ_VERSION = "6.3.10"
API_VERSION = "3.0.1"

######################################
Expand Down
2 changes: 1 addition & 1 deletion portality/static/js/edges/public.journal.edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ $.extend(true, doaj, {
category: "facet",
field: "index.country.exact",
display: "Publishers' countries",
size: 100,
size: 200,
syncCounts: false,
lifecycle: "update",
updateType: "fresh",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='doaj',
version='6.3.9',
version='6.3.10',
packages=find_packages(),
install_requires=[
"awscli==1.20.50",
Expand Down

0 comments on commit db655b2

Please sign in to comment.