Skip to content

Commit

Permalink
Fix DOI configuration handling
Browse files Browse the repository at this point in the history
  • Loading branch information
hevp committed Apr 1, 2020
1 parent 47585ac commit 8489dbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions b2share/modules/records/serializers/schemas/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ def filter_internal(self, data):
g.record_hit['_source'])

if '_deposit' in data['metadata']:
if hasattr(g, 'record') and is_deposit(record.model) and current_app.config['AUTOMATICALLY_ASSIGN_DOI']:
if hasattr(g, 'record') and is_deposit(record.model) and current_app.config.get('AUTOMATICALLY_ASSIGN_DOI', False):
# add future DOI string
data['metadata'].update({'future_doi': generate_doi(data['metadata']['_deposit']['id']) })
data['metadata'].update({'$future_doi': generate_doi(data['metadata']['_deposit']['id']) })

data['metadata']['owners'] = data['metadata']['_deposit']['owners']

Expand Down

0 comments on commit 8489dbe

Please sign in to comment.