diff --git a/rdmo_plugins/exports/zenodo.py b/rdmo_plugins/exports/zenodo.py index 3c9ab40..9c30eec 100644 --- a/rdmo_plugins/exports/zenodo.py +++ b/rdmo_plugins/exports/zenodo.py @@ -13,10 +13,6 @@ class ZenodoExportProvider(OauthProviderMixin, Export): - authorize_url = 'https://sandbox.zenodo.org/oauth/authorize' - token_url = 'https://sandbox.zenodo.org/oauth/token' - deposit_url = 'https://sandbox.zenodo.org/api/deposit/depositions' - class Form(forms.Form): dataset = forms.CharField(label=_('Select dataset of your project')) @@ -71,6 +67,22 @@ def client_id(self): def client_secret(self): return settings.ZENODO_PROVIDER['client_secret'] + @property + def zenodo_url(self): + return settings.ZENODO_PROVIDER.get('zenodo_url', 'https://sandbox.zenodo.org').strip('/') + + @property + def authorize_url(self): + return '{}/oauth/authorize'.format(self.zenodo_url) + + @property + def token_url(self): + return '{}/oauth/token'.format(self.zenodo_url) + + @property + def deposit_url(self): + return '{}/api/deposit/depositions'.format(self.zenodo_url) + @property def redirect_path(self): return reverse('oauth_callback', args=['zenodo'])