Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion journal/formats/articlemeta_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def _format_basic_info(self):
add_to_result("v117", self.obj.standard.code if self.obj.standard and self.obj.standard.code else None, self.result)
add_items("v350", [lang.code2 for lang in self.obj.text_language.all()], self.result)
add_items("v360", [lang.code2 for lang in self.obj.abstract_language.all()], self.result)
add_items("v900", [annotation.notes for annotation in self.obj.annotation.all()], self.result)
add_items("v900", [annotation.notes for annotation in self.obj.notes.all()], self.result)

def _format_contact_address_info(self):
address = self.obj.contact_address
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Generated by Django 5.2.7 on 2026-02-07 22:46

from django.db import migrations
import modelcluster.fields
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
("journal", "0057_artificialintelligence"),
]

operations = [
# Rename related_name: journalsocialnetwork -> social_networks
migrations.AlterField(
model_name="journalsocialnetwork",
name="page",
field=modelcluster.fields.ParentalKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="social_networks",
to="journal.journal",
),
),
# Rename related_name: annotation -> notes
migrations.AlterField(
model_name="annotation",
name="journal",
field=modelcluster.fields.ParentalKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="notes",
to="journal.journal",
),
),
# Rename related_name: accepted_documment_types -> accepted_document_types (fix typo)
migrations.AlterField(
model_name="accepteddocumenttypes",
name="journal",
field=modelcluster.fields.ParentalKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="accepted_document_types",
to="journal.journal",
),
),
# Rename related_name: file_oa -> open_science_form_files
migrations.AlterField(
model_name="fileopenscience",
name="journal",
field=modelcluster.fields.ParentalKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="open_science_form_files",
to="journal.journal",
),
),
# Rename related_name: ecommittee -> ethics_committee
migrations.AlterField(
model_name="ecommittee",
name="journal",
field=modelcluster.fields.ParentalKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="ethics_committee",
to="journal.journal",
),
),
# Rename related_name: review -> peer_review
migrations.AlterField(
model_name="review",
name="journal",
field=modelcluster.fields.ParentalKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="peer_review",
to="journal.journal",
),
),
]
20 changes: 10 additions & 10 deletions journal/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ def autocomplete_custom_queryset_filter(search_term):
),
FieldPanel("submission_online_url"),
FieldPanel("main_collection"),
InlinePanel("journalsocialnetwork", label=_("Social Network")),
InlinePanel("social_networks", label=_("Social Network")),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot crie os arquivos das migrações

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arquivo de migração criado em commit e33a7f2. O arquivo 0058_rename_journal_inline_panel_related_names.py documenta as alterações dos related_name para os 6 modelos (JournalSocialNetwork, Annotation, AcceptedDocumentTypes, FileOpenScience, Ecommittee, Review).

FieldPanel("frequency"),
FieldPanel("publishing_model"),
FieldPanel("standard"),
Expand All @@ -673,21 +673,21 @@ def autocomplete_custom_queryset_filter(search_term):
FieldPanel("open_access"),
FieldPanel("url_oa"),
InlinePanel(
"file_oa", label=_("Open Science accordance form"), classname="collapsed"
"open_science_form_files", label=_("Open Science accordance form"), classname="collapsed"
),
FieldPanel("journal_use_license"),
InlinePanel("open_access_text", label=_("Open Access"), classname="collapsed"),
InlinePanel("open_data", label=_("Open data"), classname="collapsed"),
InlinePanel("preprint", label=_("Preprint"), classname="collapsed"),
InlinePanel("review", label=_("Peer review"), classname="collapsed"),
InlinePanel("peer_review", label=_("Peer review"), classname="collapsed"),
InlinePanel(
"open_science_compliance",
label=_("Open Science Compliance"),
classname="collapsed",
),
]

panels_notes = [InlinePanel("annotation", label=_("Notes"), classname="collapsed")]
panels_notes = [InlinePanel("notes", label=_("Notes"), classname="collapsed")]

panels_legacy_compatibility_fields = [
FieldPanel("alphabet"),
Expand Down Expand Up @@ -1374,7 +1374,7 @@ def migrate_copyright_holder_history_to_raw(self):

class FileOpenScience(Orderable, FileWithLang, CommonControlField):
journal = ParentalKey(
Journal, on_delete=models.SET_NULL, related_name="file_oa", null=True
Journal, on_delete=models.SET_NULL, related_name="open_science_form_files", null=True
)
file = models.ForeignKey(
"wagtaildocs.Document",
Expand Down Expand Up @@ -1584,7 +1584,7 @@ class JournalSocialNetwork(Orderable, SocialNetwork):
page = ParentalKey(
Journal,
on_delete=models.SET_NULL,
related_name="journalsocialnetwork",
related_name="social_networks",
null=True,
)

Expand Down Expand Up @@ -1669,7 +1669,7 @@ class Review(Orderable, RichTextWithLanguage, CommonControlField):
null=True, blank=True, help_text=_("Brief description of the review flow")
)
journal = ParentalKey(
Journal, on_delete=models.SET_NULL, related_name="review", null=True
Journal, on_delete=models.SET_NULL, related_name="peer_review", null=True
)


Expand All @@ -1683,7 +1683,7 @@ class Ecommittee(Orderable, RichTextWithLanguage, CommonControlField):
),
)
journal = ParentalKey(
Journal, on_delete=models.SET_NULL, related_name="ecommittee", null=True
Journal, on_delete=models.SET_NULL, related_name="ethics_committee", null=True
)


Expand Down Expand Up @@ -1861,7 +1861,7 @@ class AcceptedDocumentTypes(Orderable, RichTextWithLanguage, CommonControlField)
journal = ParentalKey(
Journal,
on_delete=models.SET_NULL,
related_name="accepted_documment_types",
related_name="accepted_document_types",
null=True,
)
rich_text = RichTextField(
Expand Down Expand Up @@ -2744,7 +2744,7 @@ def __str__(self):

class Annotation(CommonControlField):
journal = ParentalKey(
Journal, on_delete=models.SET_NULL, related_name="annotation", null=True
Journal, on_delete=models.SET_NULL, related_name="notes", null=True
)
notes = models.TextField(_("Notes"), blank=True, null=True)
creation_date = models.DateField(_("Creation Date"), blank=True, null=True)
Expand Down
18 changes: 9 additions & 9 deletions journal/proxys.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class JournalProxyEditor(Journal):
InlinePanel("related_journal_urls", label=_("Journal Urls")),
FieldPanel("submission_online_url"),
FieldPanel("main_collection"),
InlinePanel("journalsocialnetwork", label=_("Social Network")),
InlinePanel("social_networks", label=_("Social Network")),
FieldPanel("frequency"),
FieldPanel("publishing_model"),
FieldPanel("standard"),
Expand All @@ -57,12 +57,12 @@ class JournalProxyEditor(Journal):
panels_open_science = [
FieldPanel("open_access"),
FieldPanel("url_oa"),
InlinePanel("file_oa", label=_("Open Science accordance form")),
InlinePanel("open_science_form_files", label=_("Open Science accordance form")),
FieldPanel("journal_use_license"),
InlinePanel("open_access_text", label=_("Open Access")),
InlinePanel("open_data", label=_("Open data")),
InlinePanel("preprint", label=_("Preprint")),
InlinePanel("review", label=_("Peer review")),
InlinePanel("peer_review", label=_("Peer review")),
InlinePanel(
"open_science_compliance",
label=_("Open Science Compliance"),
Expand All @@ -75,7 +75,7 @@ class JournalProxyEditor(Journal):
label=_("Ethics"),
),
InlinePanel(
"ecommittee",
"ethics_committee",
label=_("Ethics Committee"),
),
InlinePanel(
Expand Down Expand Up @@ -124,11 +124,11 @@ class JournalProxyEditor(Journal):
label=_("Artificial Intelligence"),
),
]
panels_notes = [InlinePanel("annotation", label=_("Notes"))]
panels_notes = [InlinePanel("notes", label=_("Notes"))]

panels_instructions_for_authors = [
InlinePanel(
"accepted_documment_types",
"accepted_document_types",
label=_("Accepted Document Types"),
),
InlinePanel(
Expand Down Expand Up @@ -203,7 +203,7 @@ class JournalProxyPanelPolicy(Journal):
classname="collapsed",
),
InlinePanel(
"ecommittee",
"ethics_committee",
label=_("Ethics Committee"),
classname="collapsed",
),
Expand Down Expand Up @@ -283,7 +283,7 @@ class Meta:
class JournalProxyPanelInstructionsForAuthors(Journal):
panels_instructions_for_authors = [
InlinePanel(
"accepted_documment_types",
"accepted_document_types",
label=_("Accepted Document Types"),
classname="collapsed",
),
Expand Down Expand Up @@ -372,7 +372,7 @@ class JournalProxyAdminOnly(Journal):
FieldPanel("acronym_letters"),
]

panels_notes = [InlinePanel("annotation", label=_("Notes"))]
panels_notes = [InlinePanel("notes", label=_("Notes"))]

edit_handler = TabbedInterface(
[
Expand Down
12 changes: 6 additions & 6 deletions journal/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,14 @@ def get_queryset(self, request):
"journal_email",
"related_journal_urls",
"title_in_database",
"journalsocialnetwork",
"file_oa",
"social_networks",
"open_science_form_files",
"open_data",
"preprint",
"review",
"peer_review",
"open_science_compliance",
"ethics",
"ecommittee",
"ethics_committee",
"copyright",
"website_responsibility",
"author_responsibility",
Expand All @@ -247,7 +247,7 @@ def get_queryset(self, request):
"gender_issues",
"fee_charging",
"editorial_policy",
"accepted_documment_types",
"accepted_document_types",
"authors_contributions",
"preparing_manuscript",
"digital_assets",
Expand All @@ -256,7 +256,7 @@ def get_queryset(self, request):
"financing_statement",
"acknowledgements",
"additional_information",
"annotation",
"notes",
"scielojournal_set",
"scielojournal_set__collection",
)
Expand Down
10 changes: 5 additions & 5 deletions journalpage/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ def journal_bibliographic_info_page(self, request, collection_acron3, acron):
mission = journal.mission.get_object_in_preferred_language(language=language)
brief_history = journal.history.get_object_in_preferred_language(language=language)
focus_and_scope = journal.focus.get_object_in_preferred_language(language=language)
social_network = journal.journalsocialnetwork.all()
social_network = journal.social_networks.all()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot journalpage tem migração para serem criadas?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Não, journalpage não precisa de migration. As mudanças em journalpage/models.py são apenas código (chamadas aos novos related_names do Journal) e não alterações de campos do modelo JournalPage. O modelo JournalPage herda apenas de Page e RoutablePageMixin sem definir campos próprios.

Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

social_network recebe um queryset/lista (journal.social_networks.all()), mas o nome da variável/contexto está no singular e agora diverge do related_name (social_networks). Para evitar ambiguidade e facilitar manutenção, considere renomear para social_networks (incluindo a chave no context e o uso no template).

Suggested change
social_network = journal.social_networks.all()
social_networks = journal.social_networks.all()

Copilot uses AI. Check for mistakes.
preprint = journal.preprint.get_object_in_preferred_language(language=language)
open_data = journal.open_data.get_object_in_preferred_language(language=language)
review = journal.review.get_object_in_preferred_language(language=language)
ecommittee = journal.ecommittee.get_object_in_preferred_language(language=language)
review = journal.peer_review.get_object_in_preferred_language(language=language)
ecommittee = journal.ethics_committee.get_object_in_preferred_language(language=language)
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A variável local ecommittee continua usando o nome legado, mas agora aponta para journal.ethics_committee.... Para manter consistência e reduzir confusão, renomeie a variável (e a chave no context, se aplicável) para ethics_committee.

Copilot uses AI. Check for mistakes.
copyright = journal.copyright.get_object_in_preferred_language(language=language)
website_responsibility = journal.website_responsibility.get_object_in_preferred_language(language=language)
author_responsibility = journal.author_responsibility.get_object_in_preferred_language(language=language)
policies = journal.policies.get_object_in_preferred_language(language=language)
conflict_policy = journal.conflict_policy.get_object_in_preferred_language(language=language)
gender_issues = journal.gender_issues.get_object_in_preferred_language(language=language)
accepted_documment_types = journal.accepted_documment_types.get_object_in_preferred_language(language=language)
accepted_document_types = journal.accepted_document_types.get_object_in_preferred_language(language=language)
authors_contributions = journal.authors_contributions.get_object_in_preferred_language(language=language)
digital_assets = journal.digital_assets.get_object_in_preferred_language(language=language)
citations_and_references = journal.citations_and_references.get_object_in_preferred_language(language=language)
Expand Down Expand Up @@ -92,7 +92,7 @@ def journal_bibliographic_info_page(self, request, collection_acron3, acron):
"policies": policies,
"conflict_policy": conflict_policy,
"gender_issues": gender_issues,
"accepted_documment_types": accepted_documment_types,
"accepted_document_types": accepted_document_types,
"authors_contributions": authors_contributions,
"digital_assets": digital_assets,
"citations_and_references": citations_and_references,
Expand Down
2 changes: 1 addition & 1 deletion journalpage/templates/journalpage/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ <h4 id="instructions">{% trans 'INSTRUÇÕES PARA OS AUTORES' %}</h4>
<h5 id="item-4-1">{% trans 'Tipos de documentos aceitos' %}</h5>
<!-- Pode haver mais de um. Permitir adicionar novo -->
<ul type="disc">
{% for adt in accepted_documment_types %}
{% for adt in accepted_document_types %}
{{ adt.rich_text|richtext }}
{% endfor %}
</ul>
Expand Down
Loading