Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_doi(data):
"""
Generate doi for a given dataset
"""
from datacite.models import DOI
doi, c = DOI.objects.get_or_create(slug=settings.DATACITE_FORMAT % {'slug': data.slug.__str__().upper(),
'version': data.version},
data=data)
return doi