Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global: fix current_records_rest.default_endpoint_prefixes update #150

Open
nharraud opened this issue Nov 11, 2016 · 0 comments
Open

global: fix current_records_rest.default_endpoint_prefixes update #150

nharraud opened this issue Nov 11, 2016 · 0 comments

Comments

@nharraud
Copy link
Member

nharraud commented Nov 11, 2016

Problem:
In ext.py we have this code:

A       @blueprint.record_once
        def extend_default_endpoint_prefixes(_):
             ...
B            current_records_rest = app.extensions['invenio-records-rest']
             ...

C       app.register_blueprint(blueprint)

c calls A right away. B depends on invenio-records-rest being already loaded.

Temporary Solution:
We cannot load the blueprint out of ext.py as create_blueprint needs the config.
Thus the simplest fix for now is to use @app.before_first_request.

Problem with this solution:
This however means that one cannot use default_endpoint_prefixes before the first request.

@nharraud nharraud added this to the I3B-API-Docs milestone Nov 11, 2016
@nharraud nharraud self-assigned this Nov 11, 2016
nharraud pushed a commit to nharraud/invenio-deposit that referenced this issue Nov 11, 2016
* FIX Fixes ext dependency on invenio-records-rest loading order
  by updating default_endpoint_prefixes on first request.
  (closes inveniosoftware#150)

Signed-off-by: Nicolas Harraudeau <nicolas.harraudeau@cern.ch>
nharraud pushed a commit to nharraud/invenio-deposit that referenced this issue Nov 11, 2016
* FIX Fixes ext dependency on invenio-records-rest loading order
  by updating default_endpoint_prefixes on first request.
  (closes inveniosoftware#150)

* Fixes tests by setting a default
  RECORDS_UI_DEFAULT_PERMISSION_FACTORY.

Signed-off-by: Nicolas Harraudeau <nicolas.harraudeau@cern.ch>
nharraud pushed a commit to nharraud/invenio-deposit that referenced this issue Nov 14, 2016
* FIX Fixes ext dependency on invenio-records-rest loading order
  by updating default_endpoint_prefixes on first request.
  (addresses inveniosoftware#150)

* Fixes tests by setting a default
  RECORDS_UI_DEFAULT_PERMISSION_FACTORY.

Signed-off-by: Nicolas Harraudeau <nicolas.harraudeau@cern.ch>
nharraud pushed a commit to nharraud/invenio-deposit that referenced this issue Nov 14, 2016
* FIX Fixes ext dependency on invenio-records-rest loading order
  by updating default_endpoint_prefixes on first request.
  (addresses inveniosoftware#150)

* Fixes tests by setting a default
  RECORDS_UI_DEFAULT_PERMISSION_FACTORY.

Signed-off-by: Nicolas Harraudeau <nicolas.harraudeau@cern.ch>
jirikuncar pushed a commit to nharraud/invenio-deposit that referenced this issue Nov 22, 2016
* FIX Fixes dependency on Invenio-Records-REST extension loading order
  by updating `default_endpoint_prefixes` on before first request.
  (addresses inveniosoftware#150)

Signed-off-by: Nicolas Harraudeau <nicolas.harraudeau@cern.ch>
jirikuncar pushed a commit to nharraud/invenio-deposit that referenced this issue Nov 23, 2016
* FIX Fixes dependency on Invenio-Records-REST extension loading order
  by updating `default_endpoint_prefixes` on before first request.
  (addresses inveniosoftware#150)

Signed-off-by: Nicolas Harraudeau <nicolas.harraudeau@cern.ch>
jirikuncar pushed a commit to nharraud/invenio-deposit that referenced this issue Nov 23, 2016
* FIX Fixes dependency on Invenio-Records-REST extension loading order
  by updating `default_endpoint_prefixes` on before first request.
  (addresses inveniosoftware#150)

Signed-off-by: Nicolas Harraudeau <nicolas.harraudeau@cern.ch>
jirikuncar pushed a commit to nharraud/invenio-deposit that referenced this issue Nov 23, 2016
* FIX Fixes dependency on Invenio-Records-REST extension loading order
  by updating `default_endpoint_prefixes` on before first request.
  (addresses inveniosoftware#150)

Signed-off-by: Nicolas Harraudeau <nicolas.harraudeau@cern.ch>
jirikuncar pushed a commit to nharraud/invenio-deposit that referenced this issue Nov 23, 2016
* FIX Fixes dependency on Invenio-Records-REST extension loading order
  by updating `default_endpoint_prefixes` on before first request.
  (addresses inveniosoftware#150)

Signed-off-by: Nicolas Harraudeau <nicolas.harraudeau@cern.ch>
nharraud pushed a commit to nharraud/invenio-deposit that referenced this issue Nov 23, 2016
* FIX Fixes dependency on Invenio-Records-REST extension loading order
  by updating `default_endpoint_prefixes` on before first request.
  (addresses inveniosoftware#150)

Signed-off-by: Nicolas Harraudeau <nicolas.harraudeau@cern.ch>
nharraud pushed a commit to nharraud/invenio-deposit that referenced this issue Nov 23, 2016
* FIX Fixes dependency on Invenio-Records-REST extension loading order
  by updating `default_endpoint_prefixes` on before first request.
  (addresses inveniosoftware#150)

Signed-off-by: Nicolas Harraudeau <nicolas.harraudeau@cern.ch>
Co-authored-by: Jiri Kuncar <jiri.kuncar@cern.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant