Skip to content

Commit

Permalink
Fix zenodo plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Aug 28, 2023
1 parent 4c01319 commit f11a67a
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions rdmo_plugins/exports/zenodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down Expand Up @@ -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'])
Expand Down

0 comments on commit f11a67a

Please sign in to comment.