mirror of
https://github.com/Cian-H/invenio-config-iform.git
synced 2025-12-22 21:11:57 +00:00
global: migrate to v10
This commit is contained in:
6
.github/workflows/tests.yml
vendored
6
.github/workflows/tests.yml
vendored
@@ -23,13 +23,13 @@ jobs:
|
||||
python-version: [3.8, 3.9]
|
||||
requirements-level: [pypi]
|
||||
db-service: [postgresql13]
|
||||
search-service: [elasticsearch7]
|
||||
search-service: [opensearch2]
|
||||
include:
|
||||
- db-service: postgresql13
|
||||
DB_EXTRAS: "postgresql"
|
||||
|
||||
- search-service: elasticsearch7
|
||||
SEARCH_EXTRAS: "elasticsearch7"
|
||||
- search-service: opensearch2
|
||||
SEARCH_EXTRAS: "opensearch2"
|
||||
|
||||
env:
|
||||
DB: ${{ matrix.db-service }}
|
||||
|
||||
@@ -15,7 +15,6 @@ encoding = utf-8
|
||||
|
||||
[jinja2: **/templates/**.*]
|
||||
encoding = utf-8
|
||||
extensions = jinja2.ext.autoescape, jinja2.ext.with_
|
||||
|
||||
# Extraction from JavaScript files
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ release = __version__
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = None
|
||||
language = "en"
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
|
||||
@@ -151,10 +151,10 @@ The succinct encoding of the permissions for your instance gives you
|
||||
- great flexibility by defining your own actions, generators and policies
|
||||
"""
|
||||
|
||||
from elasticsearch_dsl.query import Q
|
||||
from flask import current_app, request
|
||||
from invenio_access.permissions import any_user
|
||||
from invenio_records_permissions.generators import Generator
|
||||
from invenio_search.engine import dsl
|
||||
|
||||
|
||||
class RecordIp(Generator):
|
||||
@@ -208,10 +208,10 @@ class RecordIp(Generator):
|
||||
|
||||
if not visible:
|
||||
# If user ip is not on the list, and If the record contains 'singleip' will not be seen
|
||||
return ~Q("match", **{"access.access_right": "singleip"})
|
||||
return ~dsl.Q("match", **{"access.access_right": "singleip"})
|
||||
|
||||
# Lists all records
|
||||
return Q("match_all")
|
||||
return dsl.Q("match_all")
|
||||
|
||||
def check_permission(self):
|
||||
"""Check for User IP address in config variable."""
|
||||
|
||||
10
setup.cfg
10
setup.cfg
@@ -37,16 +37,18 @@ python_requires = >=3.8
|
||||
zip_safe = False
|
||||
install_requires =
|
||||
# keep this dependencies identical to invenio-app-rdm
|
||||
invenio-rdm-records>=0.35.16,<0.36.0
|
||||
invenio-rdm-records>=0.39.0,<0.40.0
|
||||
invenio-cache>=1.1.1,<1.2.0
|
||||
|
||||
[options.extras_require]
|
||||
tests =
|
||||
pytest-black>=0.3.0,<0.3.10
|
||||
sphinx>=4.2.0,<5
|
||||
Sphinx>=4.5.0
|
||||
pytest-invenio>=1.4.7
|
||||
elasticsearch7 =
|
||||
invenio-search[elasticsearch7]>=1.4.2,<2.0
|
||||
# elasticsearch7 =
|
||||
# invenio-search[elasticsearch7]>=2.1.0,<3.0.0
|
||||
opensearch2 =
|
||||
invenio-search[opensearch2]>=2.1.0,<3.0.0
|
||||
|
||||
[options.entry_points]
|
||||
invenio_base.apps =
|
||||
|
||||
Reference in New Issue
Block a user