Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #1702

Merged
merged 2 commits into from
Aug 6, 2024
Merged

Release #1702

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
1 change: 1 addition & 0 deletions .platform.app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ hooks:
poetry run python manage.py collectstatic --no-input
deploy: |
poetry run python manage.py rename_app authors people
poetry run python manage.py migrate
web:
Expand Down
2 changes: 1 addition & 1 deletion config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"etna.alerts",
"etna.analytics",
"etna.articles",
"etna.authors",
"etna.people",
"etna.categories",
"etna.ciim",
"etna.collections",
Expand Down
14 changes: 7 additions & 7 deletions etna/api/tests/expected_results/author.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"id": AUTHOR_ID,
"meta": {
"type": "authors.AuthorPage",
"type": "people.PersonPage",
"detail_url": "/api/v2/pages/AUTHOR_ID/",
"html_url": "http://localhost/authors/author/",
"html_url": "http://localhost/people/author/",
"slug": "author",
"show_in_menus": false,
"seo_title": "",
Expand All @@ -13,15 +13,15 @@
"parent": {
"id": AUTHOR_INDEX_ID,
"meta": {
"type": "authors.AuthorIndexPage",
"type": "people.PeopleIndexPage",
"detail_url": "/api/v2/pages/AUTHOR_INDEX_ID/",
"html_url": "http://localhost/authors/"
"html_url": "http://localhost/people/"
},
"title": "authors"
"title": "people"
},
"privacy": "public",
"last_published_at": "2000-01-01T00:00:00Z",
"url": "/authors/author/"
"url": "/people/author/"
},
"title": "author",
"global_alert": {
Expand All @@ -31,7 +31,7 @@
"cascade": true,
"uid": ALERT_UID
},
"type_label": "Author",
"type_label": "Person",
"teaser_text": "Teaser text",
"teaser_image": {
"id": 10,
Expand Down
6 changes: 3 additions & 3 deletions etna/api/tests/expected_results/focused_article.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@
{
"id": AUTHOR_ID,
"title": "author",
"url": "/authors/author/",
"full_url": "http://localhost/authors/author/",
"type_label": "Author",
"url": "/people/author/",
"full_url": "http://localhost/people/author/",
"type_label": "Person",
"teaser_text": "Teaser text",
"teaser_image": {
"id": 10,
Expand Down
14 changes: 7 additions & 7 deletions etna/api/tests/expected_results/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@
},
{
"id": AUTHOR_INDEX_ID,
"title": "authors",
"url": "/authors/",
"full_url": "http://localhost/authors/",
"type_label": "Author index",
"title": "people",
"url": "/people/",
"full_url": "http://localhost/people/",
"type_label": "People index",
"teaser_text": "Teaser text",
"teaser_image": {
"id": 8,
Expand All @@ -136,9 +136,9 @@
{
"id": AUTHOR_ID,
"title": "author",
"url": "/authors/author/",
"full_url": "http://localhost/authors/author/",
"type_label": "Author",
"url": "/people/author/",
"full_url": "http://localhost/people/author/",
"type_label": "Person",
"teaser_text": "Teaser text",
"teaser_image": {
"id": 10,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"id": AUTHOR_INDEX_ID,
"meta": {
"type": "authors.AuthorIndexPage",
"type": "people.PeopleIndexPage",
"detail_url": "/api/v2/pages/AUTHOR_INDEX_ID/",
"html_url": "http://localhost/authors/",
"slug": "authors",
"html_url": "http://localhost/people/",
"slug": "people",
"show_in_menus": false,
"seo_title": "",
"search_description": "",
Expand All @@ -21,17 +21,17 @@
},
"privacy": "public",
"last_published_at": null,
"url": "/authors/"
"url": "/people/"
},
"title": "authors",
"title": "people",
"global_alert": {
"title": "BETA",
"message": "<p>Message</p>",
"alert_level": "high",
"cascade": true,
"uid": ALERT_UID
},
"type_label": "Author index",
"type_label": "People index",
"teaser_text": "Teaser text",
"teaser_image": {
"id": 8,
Expand Down Expand Up @@ -71,13 +71,13 @@
"title": "Test title",
"message": "<p>Test message</p>"
},
"author_pages": [
"people_pages": [
{
"id": AUTHOR_ID,
"title": "author",
"url": "/authors/author/",
"full_url": "http://localhost/authors/author/",
"type_label": "Author",
"url": "/people/author/",
"full_url": "http://localhost/people/author/",
"type_label": "Person",
"teaser_text": "Teaser text",
"teaser_image": {
"id": 10,
Expand Down
10 changes: 5 additions & 5 deletions etna/api/tests/test_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
FocusedArticlePageFactory,
)
from etna.articles.models import ArticleTag
from etna.authors.factories import AuthorIndexPageFactory, AuthorPageFactory
from etna.authors.models import AuthorTag
from etna.collections.factories import (
HighlightGalleryPageFactory,
TimePeriodPageFactory,
Expand All @@ -25,6 +23,8 @@
from etna.collections.models import Highlight, PageTimePeriod, PageTopic
from etna.home.models import MourningNotice
from etna.media.models import EtnaMedia
from etna.people.factories import PeopleIndexPageFactory, PersonPageFactory
from etna.people.models import AuthorTag

API_URL = "/api/v2/pages/"

Expand Down Expand Up @@ -113,14 +113,14 @@ def setUpTestData(cls):
first_published_at=DATE_1,
)

cls.author_index_page = AuthorIndexPageFactory(
cls.author_index_page = PeopleIndexPageFactory(
parent=cls.root_page,
title="authors",
title="people",
first_published_at=DATE_1,
alert=cls.alert,
)

cls.author_page = AuthorPageFactory(
cls.author_page = PersonPageFactory(
title="author",
role="Test Author",
summary="<p>Summary text</p>",
Expand Down
3 changes: 2 additions & 1 deletion etna/articles/migrations/0009_add_author_block.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Generated by Django 3.1.8 on 2021-07-26 16:15
# etna:allowAlterField

from django.db import migrations
import etna.records.blocks
Expand All @@ -25,7 +26,7 @@ class Migration(migrations.Migration):
(
"author",
wagtail.snippets.blocks.SnippetChooserBlock(
"authors.Author"
"people.Author"
),
)
]
Expand Down
2 changes: 1 addition & 1 deletion etna/articles/migrations/0012_add_related_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Migration(migrations.Migration):
(
"author",
wagtail.snippets.blocks.SnippetChooserBlock(
"authors.Author"
"people.Author"
),
)
]
Expand Down
2 changes: 1 addition & 1 deletion etna/articles/migrations/0014_alter_field_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Migration(migrations.Migration):
(
"author",
wagtail.snippets.blocks.SnippetChooserBlock(
"authors.Author"
"people.Author"
),
)
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Generated by Django 4.2.5 on 2023-09-25 10:55
# etna:allowAlterField

from django.db import migrations, models
import django.db.models.deletion
Expand All @@ -15,7 +16,7 @@ def convert_to_foreign_key(apps, schema_editor):

class Migration(migrations.Migration):
dependencies = [
("authors", "0002_authorindexpage_authorpage_authortag_delete_author"),
("people", "0002_authorindexpage_authorpage_authortag_delete_author"),
("articles", "0097_alter_articlepage_mark_new_on_next_publish_and_more"),
]

Expand All @@ -29,7 +30,7 @@ class Migration(migrations.Migration):
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="focused_articles",
to="authors.authorpage",
to="people.authorpage",
),
),
]
2 changes: 1 addition & 1 deletion etna/articles/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from rest_framework import serializers
from taggit.models import ItemBase, TagBase

from etna.authors.models import AuthorPageMixin
from etna.collections.models import TopicalPageMixin
from etna.core.blocks import AuthorPromotedPagesBlock, FeaturedCollectionBlock
from etna.core.models import (
Expand All @@ -44,6 +43,7 @@
TaggableSerializer,
)
from etna.core.utils import skos_id_from_text
from etna.people.models import AuthorPageMixin
from etna.records.fields import RecordField

from .blocks import ArticlePageStreamBlock
Expand Down
1 change: 1 addition & 0 deletions etna/core/management/commands/rename_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def handle(self, old_app_name, new_app_name, *args, **options):
f"WHERE app_label='{new_app_name}'"
)
app_content_types = cursor.fetchall()
app_content_types.pop(0)

for content_type in app_content_types:
old_table_name = truncate_name(
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions etna/authors/apps.py → etna/people/apps.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.apps import AppConfig


class AuthorsAppConfig(AppConfig):
class PeopleAppConfig(AppConfig):
default_auto_field = "django.db.models.AutoField"
name = "etna.authors"
verbose_name = "Authors"
name = "etna.people"
verbose_name = "People"
10 changes: 5 additions & 5 deletions etna/authors/factories.py → etna/people/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@

from wagtail_factories import ImageFactory, PageFactory

from etna.authors.models import AuthorIndexPage, AuthorPage
from etna.people.models import PeopleIndexPage, PersonPage


class AuthorIndexPageFactory(PageFactory):
class PeopleIndexPageFactory(PageFactory):
teaser_text = "Teaser text"
teaser_image = factory.SubFactory(ImageFactory)

class Meta:
model = AuthorIndexPage
model = PeopleIndexPage


class AuthorPageFactory(PageFactory):
class PersonPageFactory(PageFactory):
image = factory.SubFactory(ImageFactory)
teaser_text = "Teaser text"
teaser_image = factory.SubFactory(ImageFactory)

class Meta:
model = AuthorPage
model = PersonPage

@factory.post_generation
def set_publish_dates(obj, create, extracted, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Generated by Django 4.2.5 on 2023-09-25 10:55
# etna:allowDeleteModel

from django.db import migrations, models
import django.db.models.deletion
Expand All @@ -13,7 +14,7 @@ class Migration(migrations.Migration):
dependencies = [
("images", "0008_alter_customimagerendition_file"),
("wagtailcore", "0089_log_entry_data_json_null_to_object"),
("authors", "0001_initial"),
("people", "0001_initial"),
]

operations = [
Expand Down Expand Up @@ -175,7 +176,7 @@ class Migration(migrations.Migration):
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="author_pages",
to="authors.authorpage",
to="people.authorpage",
verbose_name="author",
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Migration(migrations.Migration):

dependencies = [
("alerts", "0001_initial"),
("authors", "0002_authorindexpage_authorpage_authortag_delete_author"),
("people", "0002_authorindexpage_authorpage_authortag_delete_author"),
]

operations = [
Expand Down
20 changes: 20 additions & 0 deletions etna/people/migrations/0004_alter_personpage_options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 5.0.7 on 2024-08-01 11:14

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("people", "0003_authorindexpage_alert_authorpage_alert"),
]

operations = [
migrations.AlterModelOptions(
name="authorpage",
options={
"verbose_name": "Person page",
"verbose_name_plural": "People pages",
},
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 5.0.7 on 2024-08-01 11:21
# etna:allowRenameModel

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("alerts", "0003_alert_name_alter_alert_title"),
("images", "0009_alter_customimage_custom_sensitive_image_warning"),
("people", "0004_alter_personpage_options"),
("wagtailcore", "0093_uploadedfile"),
]

operations = [
migrations.RenameModel(
old_name="AuthorIndexPage",
new_name="PeopleIndexPage",
),
migrations.RenameModel(
old_name="AuthorPage",
new_name="PersonPage",
),
]
Loading
Loading