Dear Gitlab users, due to maintenance reasons, Gitlab will not be available on Thursday 30.09.2021 from 5:00 pm to approximately 5:30 pm.

Commit a0219e66 authored by felix.herrmann's avatar felix.herrmann
Browse files

Merge branch '429-data-submission-aggreement-generation-on-saving-fails' into 'master'

Resolve "Data submission aggreement generation on saving fails"

Closes #429

See merge request !404
parents 2d13be8a bc475567
......@@ -795,6 +795,12 @@ class DataSet(models.Model):
else:
return self.license.get_license_name()
def get_license_text_from_ds(self):
if not self.license:
return "No license"
else:
return self.license.get_license_text()
def license_is_valid(self):
""" use the DD_LICENSE_MATRIX map to check if a license
(given by slug) is in the list of a data access model
......@@ -854,8 +860,8 @@ class DataSet(models.Model):
"[[SPONSORS]]": self.funding,
"[[ACCESS_MODEL]]": self.get_data_access_display(),
"[[ACCESS_TEXT]]": access_text,
"[[LICENSE]]": self.license.get_license_name(),
"[[LICENSE_TEXT]]": self.license.get_license_text(),
"[[LICENSE]]": self.get_license_name_from_ds(),
"[[LICENSE_TEXT]]": self.get_license_text_from_ds(),
}
if dsa_page:
dsa_text = str(dsa_page.body)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment