This commit is contained in:
Tim Lorsbach
2025-11-11 19:59:03 +01:00
parent 91a52c254d
commit ab43e0b5fe

View File

@ -93,11 +93,12 @@ class Command(BaseCommand):
"""Create the six default licenses supported by enviPath""" """Create the six default licenses supported by enviPath"""
cc_strings = ["by", "by-nc", "by-nc-nd", "by-nc-sa", "by-nd", "by-sa"] cc_strings = ["by", "by-nc", "by-nc-nd", "by-nc-sa", "by-nd", "by-sa"]
for cc_string in cc_strings: for cc_string in cc_strings:
new_license = License() if not License.objects.filter(cc_string=cc_string).exists():
new_license.cc_string = cc_string new_license = License()
new_license.link = f"https://creativecommons.org/licenses/{cc_string}/4.0/" new_license.cc_string = cc_string
new_license.image_link = f"https://licensebuttons.net/l/{cc_string}/4.0/88x31.png" new_license.link = f"https://creativecommons.org/licenses/{cc_string}/4.0/"
new_license.save() new_license.image_link = f"https://licensebuttons.net/l/{cc_string}/4.0/88x31.png"
new_license.save()
def import_package(self, data, owner): def import_package(self, data, owner):
return PackageManager.import_legacy_package( return PackageManager.import_legacy_package(