From cc7105872661fb68a40d0938679487056a531905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pe=C5=A1=C3=ADk?= Date: Fri, 6 Dec 2024 21:37:52 +0100 Subject: [PATCH] Minor updates --- webclient/doi/model_serializers.py | 6 ++++-- ... => 0013_dokument_doi_alter_dokument_jazyky_and_more.py} | 6 +++--- webclient/dokument/models.py | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) rename webclient/dokument/migrations/{0013_dokumentcast_doi_alter_dokument_jazyky_and_more.py => 0013_dokument_doi_alter_dokument_jazyky_and_more.py} (68%) diff --git a/webclient/doi/model_serializers.py b/webclient/doi/model_serializers.py index 9396dfc15..4bf9e9a74 100644 --- a/webclient/doi/model_serializers.py +++ b/webclient/doi/model_serializers.py @@ -212,7 +212,7 @@ def _serialize_komponenty_m2n_fields(komponenty): def serialize_organizace(organizace: Organizace): serialized_organizace = {"name": organizace.nazev} if organizace.ror: - serialized_organizace["affiliationIdentifier"] = f"https://ror.org/{organizace.ro}" + serialized_organizace["affiliationIdentifier"] = f"https://ror.org/{organizace.ror}" serialized_organizace["affiliationIdentifierScheme"] = "ROR" serialized_organizace["schemeUri"] = "https://ror.org/" return serialized_organizace @@ -451,7 +451,9 @@ def _serialize_rights_list(self): spdx_query = self.object.licence.heslar_odkaz.filter(zdroj="SPDX") if spdx_query.exists(): serialized_rights["rightsUri"] = self.object.licence.heslar_odkaz.filter(zdroj="SPDX").first().uri - serialized_rights["schemeUri"] = self.object.licence.heslar_odkaz.filter(zdroj="SPDX").first().uri + serialized_rights["schemeUri"] = ( + self.object.licence.heslar_odkaz.filter(zdroj="SPDX").first().scheme_uri + ) serialized_rights["rightsIdentifier"] = ( self.object.licence.heslar_odkaz.filter(zdroj="SPDX").first().kod ) diff --git a/webclient/dokument/migrations/0013_dokumentcast_doi_alter_dokument_jazyky_and_more.py b/webclient/dokument/migrations/0013_dokument_doi_alter_dokument_jazyky_and_more.py similarity index 68% rename from webclient/dokument/migrations/0013_dokumentcast_doi_alter_dokument_jazyky_and_more.py rename to webclient/dokument/migrations/0013_dokument_doi_alter_dokument_jazyky_and_more.py index 65444e8d6..a0dd5b3c4 100644 --- a/webclient/dokument/migrations/0013_dokumentcast_doi_alter_dokument_jazyky_and_more.py +++ b/webclient/dokument/migrations/0013_dokument_doi_alter_dokument_jazyky_and_more.py @@ -1,4 +1,4 @@ -# Generated by Django 5.1.3 on 2024-11-30 18:54 +# Generated by Django 5.1.3 on 2024-12-06 20:32 from django.db import migrations, models @@ -7,12 +7,12 @@ class Migration(migrations.Migration): dependencies = [ ("dokument", "0012_alter_dokument_options_and_more"), - ("heslar", "0007_alter_heslar_unique_together_and_more"), + ("heslar", "0008_heslarodkaz_scheme_uri"), ] operations = [ migrations.AddField( - model_name="dokumentcast", + model_name="dokument", name="doi", field=models.CharField(blank=True, max_length=255, null=True), ), diff --git a/webclient/dokument/models.py b/webclient/dokument/models.py index 5aadcbb7e..0ea4aa7ce 100644 --- a/webclient/dokument/models.py +++ b/webclient/dokument/models.py @@ -174,6 +174,7 @@ class Dokument(ExportModelOperationsMixin("dokument"), ModelWithMetadata): tvary = models.ManyToManyField(Heslar, through="Tvar", related_name="dokumenty_tvary") autori_snapshot = models.CharField(max_length=5000, null=True, blank=True) osoby_snapshot = models.CharField(max_length=5000, null=True, blank=True) + doi = models.CharField(max_length=255, null=True, blank=True) class Meta: db_table = "dokument" @@ -560,7 +561,6 @@ class DokumentCast(ExportModelOperationsMixin("dokument_cast"), models.Model): null=True, related_name="casti_dokumentu", ) - doi = models.CharField(max_length=255, blank=True, null=True) class Meta: db_table = "dokument_cast"