Skip to content

Conversation

@dash-baijayanti
Copy link
Contributor

Short description

  • Rename page_tree_tutorial_seen field to has_seen_page_tree_tutorial and update help text for better clarity.

Proposed changes

  • Renamed field page_tree_tutorial_seenhas_seen_page_tree_tutorial in user.py
  • Updated references in dismiss_tutorial_view.py
  • Added migration 0144_alter_user_page_tree_tutorial_seen.py
  • Changed help text to "Has seen tutorial for page tree"

Side effects

  • Migration will rename the existing field; no data loss expected.

Faithfulness to issue description and design

  • There are no intended deviations from the issue and design.

Resolved issues

Fixes: #3271

@dash-baijayanti dash-baijayanti marked this pull request as draft December 16, 2025 11:00
@dash-baijayanti dash-baijayanti marked this pull request as ready for review December 17, 2025 08:14
Copy link
Member

@MizukiTemma MizukiTemma left a comment

Choose a reason for hiding this comment

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

Thank you so much for the PR 😸
We are on a good way, but there are three points to improve.

  1. Our integreat_cms/cms/fixtures/test_data.json has still the old field name. The fixture must be in the form of models after migration. In this case we have to change page_tree_tutorial_seen to has_seen_page_tree_tutorial in this file too. Otherwise it cannot be loaded and causes an error (both in the CI and when ./tools/run.sh)

  2. There is an old field name left in integreat_cms/cms/views/pages/page_tree_view.py (L.156). We you open the page tree, you'll face this error.

Image

I think it was just slipped off from your eyes while replacing the name.

  1. We do not want to lose the current information whether user has seen the tutorial during the migration. Find detailed suggestion in the comment.

Comment on lines 12 to 24
migrations.RemoveField(
model_name="user",
name="page_tree_tutorial_seen",
),
migrations.AddField(
model_name="user",
name="has_seen_page_tree_tutorial",
field=models.BooleanField(
default=False,
help_text="Has seen tutorial for page tree",
verbose_name="Page tree tutorial seen",
),
),
Copy link
Member

Choose a reason for hiding this comment

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

It's nice that the old field is abolished and the new field is added, but there is a thing to pay attention to: the values currently stored in the database will go lost, as the new field does not inherit the current value from the old field.

To avoid this, we have to first create a new field, then transfer the stored value from the old field to the new one, then remove the old field.

An example is 0138_configurable_mt_budget.

@dash-baijayanti dash-baijayanti marked this pull request as draft December 17, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename user fields page_tree_tutorial_seen and statistics_tutorial_seen

3 participants