Skip to content

Commit

Permalink
Rename API config to namespace as DataCite
Browse files Browse the repository at this point in the history
Also default admin username
  • Loading branch information
richardhallett committed Feb 4, 2020
1 parent ce06478 commit 0beeb1f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions vendor/docker/env.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ env DATACITE_API_URL;
env OAIPMH_REPOS_NAME;
env OAIPMH_ADMIN_EMAIL;
env SENTRY_DSN;
env API_ADMIN_USERNAME;
env API_ADMIN_PASSWORD;
env DATACITE_API_ADMIN_USERNAME;
env DATACITE_API_ADMIN_PASSWORD;
env RESULT_SET_SIZE;
6 changes: 3 additions & 3 deletions viringo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# Sentry DSN
SENTRY_DSN = os.getenv('SENTRY_DSN', None)
# URL used for the DataCite REST API
DATACITE_API_URL = os.getenv('DATACITE_API_URL', 'https://api.test.datacite.org')
DATACITE_API_URL = os.getenv('DATACITE_API_URL', 'https://api.datacite.org')
# Admin credentials for the API
API_ADMIN_USERNAME = os.getenv('API_ADMIN_USERNAME')
API_ADMIN_PASSWORD = os.getenv('API_ADMIN_PASSWORD')
DATACITE_API_ADMIN_USERNAME = os.getenv('API_ADMIN_USERNAME', 'admin')
DATACITE_API_ADMIN_PASSWORD = os.getenv('API_ADMIN_PASSWORD')

# Name used to identifier the repository.
OAIPMH_REPOS_NAME = os.getenv('OAIPMH_REPOS_NAME', 'DataCite')
Expand Down
2 changes: 1 addition & 1 deletion viringo/services/datacite.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def api_call_get(url, params=None):
response = requests.get(
url,
params=payload_str,
auth=requests.auth.HTTPBasicAuth(config.API_ADMIN_USERNAME, config.API_ADMIN_PASSWORD)
auth=requests.auth.HTTPBasicAuth(config.DATACITE_API_ADMIN_USERNAME, config.DATACITE_API_ADMIN_PASSWORD)
)

return response

0 comments on commit 0beeb1f

Please sign in to comment.