bugfix: read env variables of datacite

This commit is contained in:
Unix
2021-03-12 13:10:47 +01:00
committed by Mojib Wali
parent 046b009420
commit dd4bc1ffdf
+5 -4
View File
@@ -9,6 +9,7 @@
"""invenio module for TUGRAZ theme.""" """invenio module for TUGRAZ theme."""
import binascii import binascii
from os import environ
from typing import Dict from typing import Dict
from elasticsearch_dsl.utils import AttrDict from elasticsearch_dsl.utils import AttrDict
@@ -82,10 +83,10 @@ def comingsoon():
def get_datacite_details(): def get_datacite_details():
"""Application credentials for DOI.""" """Application credentials for DOI."""
url = current_app.config.get("INVENIO_DATACITE_URL") or "" url = environ.get('INVENIO_DATACITE_URL') or ""
username = current_app.config.get("INVENIO_DATACITE_UNAME") or "" username = environ.get('INVENIO_DATACITE_UNAME') or ""
password = current_app.config.get("INVENIO_DATACITE_PASS") or "" password = environ.get('INVENIO_DATACITE_PASS') or ""
prefix = current_app.config.get("INVENIO_DATACITE_PREFIX") or "" prefix = environ.get('INVENIO_DATACITE_PREFIX') or ""
password_iv, encrypted_password = Cryptor.encrypt(password, Cryptor.KEY) password_iv, encrypted_password = Cryptor.encrypt(password, Cryptor.KEY)