This commit is contained in:
Tasos Katsoulas 2024-11-07 16:20:08 +02:00
Родитель 99e0c88a9a
Коммит 48713397b4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 66D7743B4FCCFCBC
1 изменённых файлов: 151 добавлений и 24 удалений

Просмотреть файл

@ -1,7 +1,5 @@
# Generated by Django 4.2.16 on 2024-10-15 04:43
import importlib
import django.db.models.deletion
from django.db import migrations, models
@ -120,6 +118,12 @@ NEW_TOPICS_DATA = [
"description": "Explore how to navigate the web efficiently and effectively with Mozillas products.",
"products": ["firefox", "mobile", "ios", "pocket", "hubs"],
"subtopics": [
{
"title": "Article View",
"slug": "article-view",
"description": "Comfortably read web pages without distractions.",
"products": [],
},
{
"title": "Tabs",
"slug": "tabs",
@ -139,9 +143,15 @@ NEW_TOPICS_DATA = [
"products": ["firefox", "mobile", "ios"],
},
{
"title": "Multimedia",
"slug": "multimedia",
"description": "Everything you need to know about audio, video, images, and more.",
"title": "Audio and Video",
"slug": "audio-and-video",
"description": "Everything you need to know about audio and video.",
"products": ["firefox", "mobile", "ios"],
},
{
"title": "Images and documents",
"slug": "images-and-documents",
"description": "Everything you need to know about images and documents.",
"products": ["firefox", "mobile", "ios"],
},
{
@ -150,6 +160,12 @@ NEW_TOPICS_DATA = [
"description": "Use web links in Mozillas products.",
"products": ["firefox", "mobile", "ios"],
},
{
"title": "Home screen",
"slug": "home-screen",
"description": "Add Mozillas products to your home screen for easy access.",
"products": ["firefox", "mobile", "ios"],
},
],
},
{
@ -165,6 +181,7 @@ NEW_TOPICS_DATA = [
"mdn-plus",
"focus-firefox",
"thunderbird",
"thunderbird-android",
],
"subtopics": [
{
@ -179,6 +196,27 @@ NEW_TOPICS_DATA = [
"pocket",
"focus-firefox",
"thunderbird",
"thunderbird-android",
],
},
{
"title": "Connectivity",
"slug": "connectivity",
"description": "Troubleshoot issues with connectivity.",
"products": [
"firefox-private-network-vpn",
"thunderbird",
"thunderbird-android",
],
},
{
"title": "Error codes",
"slug": "error-codes",
"description": "Troubleshoot issues with error codes.",
"products": [
"firefox",
"mobile",
"ios",
],
},
{
@ -193,8 +231,29 @@ NEW_TOPICS_DATA = [
"title": "Accessibility",
"slug": "accessibility",
"description": "Learn about Mozilla products accessibility features and settings for better usability.",
"products": ["firefox", "mobile", "ios", "pocket", "thunderbird", "mozilla-account"],
"subtopics": [],
"products": [
"firefox",
"mobile",
"ios",
"pocket",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
"subtopics": [
{
"title": "Reader View",
"slug": "reader-view",
"description": "Comfortably read web pages without distractions.",
"products": ["firefox", "mobile", "ios"],
},
{
"title": "Text-to-speech",
"slug": "text-to-speech",
"description": "Read web pages aloud.",
"products": ["firefox", "mobile", "ios", "pocket"],
},
],
},
{
"title": "Download and save",
@ -220,19 +279,42 @@ NEW_TOPICS_DATA = [
"title": "Search, tag, and share",
"slug": "search-tag-and-share",
"description": "Learn about search functionality and how to organize or share content in Mozilla products.",
"products": ["firefox", "mobile", "ios", "pocket", "focus-firefox", "thunderbird"],
"products": [
"firefox",
"mobile",
"ios",
"pocket",
"focus-firefox",
"thunderbird",
"thunderbird-android",
],
"subtopics": [
{
"title": "Search",
"slug": "search",
"description": "Find information quickly and easily.",
"products": ["firefox", "mobile", "ios", "pocket", "focus-firefox", "thunderbird"],
"products": [
"firefox",
"mobile",
"ios",
"pocket",
"focus-firefox",
"thunderbird",
"thunderbird-android",
],
},
{
"title": "Tags",
"slug": "tags",
"description": "Categorize and organize efficiently with tags.",
"products": ["firefox", "mobile", "ios", "pocket"],
"products": [
"firefox",
"mobile",
"ios",
"pocket",
"thunderbird",
"thunderbird-android",
],
},
{
"title": "Share content",
@ -255,6 +337,7 @@ NEW_TOPICS_DATA = [
"focus-firefox",
"firefox-enterprise",
"thunderbird",
"thunderbird-android",
],
"subtopics": [
{
@ -270,6 +353,7 @@ NEW_TOPICS_DATA = [
"focus-firefox",
"firefox-enterprise",
"thunderbird",
"thunderbird-android",
],
},
{
@ -285,6 +369,7 @@ NEW_TOPICS_DATA = [
"focus-firefox",
"firefox-enterprise",
"thunderbird",
"thunderbird-android",
],
},
],
@ -305,6 +390,7 @@ NEW_TOPICS_DATA = [
"focus-firefox",
"firefox-enterprise",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
"subtopics": [
@ -320,6 +406,7 @@ NEW_TOPICS_DATA = [
"focus-firefox",
"firefox-enterprise",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
},
@ -336,6 +423,7 @@ NEW_TOPICS_DATA = [
"focus-firefox",
"firefox-enterprise",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
},
@ -351,6 +439,7 @@ NEW_TOPICS_DATA = [
"focus-firefox",
"firefox-enterprise",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
},
@ -367,6 +456,7 @@ NEW_TOPICS_DATA = [
"focus-firefox",
"firefox-enterprise",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
},
@ -387,6 +477,12 @@ NEW_TOPICS_DATA = [
"mozilla-account",
],
},
{
"title": "Notifications",
"slug": "notifications",
"description": "Manage notifications in Mozillas products.",
"products": ["firefox", "mobile", "ios"],
},
],
},
{
@ -399,14 +495,21 @@ NEW_TOPICS_DATA = [
"ios",
"firefox-private-network-vpn",
"relay",
"monitor",
"pocket",
"focus-firefox",
"firefox-enterprise",
"monitor",
"pocket",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
"subtopics": [
{
"title": "Data removal",
"slug": "data-removal",
"description": "Remove your data from Mozillas products.",
"products": ["monitor"],
},
{
"title": "Tracking protection",
"slug": "tracking-protection",
@ -418,8 +521,9 @@ NEW_TOPICS_DATA = [
"firefox-private-network-vpn",
"focus-firefox",
"firefox-enterprise",
"thunderbird",
"mozilla-account",
"relay",
"pocket",
],
},
{
@ -434,6 +538,7 @@ NEW_TOPICS_DATA = [
"focus-firefox",
"firefox-enterprise",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
},
@ -455,7 +560,9 @@ NEW_TOPICS_DATA = [
"relay",
"focus-firefox",
"firefox-enterprise",
"monitor",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
},
@ -475,6 +582,7 @@ NEW_TOPICS_DATA = [
"mdn-plus",
"hubs",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
"subtopics": [
@ -488,9 +596,21 @@ NEW_TOPICS_DATA = [
"ios",
"firefox-private-network-vpn",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
},
{
"title": "Sign in",
"slug": "sign-in",
"description": "Sign in to your accounts securely.",
"products": [
"firefox",
"mobile",
"ios",
"firefox-private-network-vpn",
],
},
{
"title": "Reset passwords",
"slug": "reset-passwords",
@ -501,6 +621,7 @@ NEW_TOPICS_DATA = [
"ios",
"firefox-private-network-vpn",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
},
@ -537,6 +658,7 @@ NEW_TOPICS_DATA = [
"hubs",
"firefox-enterprise",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
"subtopics": [
@ -551,6 +673,7 @@ NEW_TOPICS_DATA = [
"pocket",
"firefox-enterprise",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
},
@ -563,6 +686,7 @@ NEW_TOPICS_DATA = [
"pocket",
"firefox-enterprise",
"thunderbird",
"thunderbird-android",
"mozilla-account",
],
},
@ -625,49 +749,49 @@ NEW_TOPICS_DATA = [
"title": "Email and messaging",
"slug": "email-and-messaging",
"description": "Read, send, and manage your emails and messages.",
"products": ["thunderbird", "relay"],
"products": ["thunderbird", "thunderbird-android", "relay"],
"subtopics": [
{
"title": "Contacts",
"slug": "contacts",
"description": "Manage your email contacts.",
"products": ["thunderbird"],
"products": ["thunderbird", "thunderbird-android"],
},
{
"title": "Junk email and spam",
"slug": "junk-mail-and-spam",
"description": "Identify and manage junk email and spam.",
"products": ["thunderbird"],
"products": ["thunderbird", "thunderbird-android"],
},
{
"title": "Instant messaging",
"slug": "instant-messaging",
"description": "Features and functionality to use with instant messaging.",
"products": ["thunderbird"],
"products": ["thunderbird", "thunderbird-android"],
},
{
"title": "Attachments",
"slug": "attachments",
"description": "Learn how to use and manage email attachments.",
"products": ["thunderbird"],
"products": ["thunderbird", "thunderbird-android"],
},
{
"title": "Send and receive email",
"slug": "send-and-receive-email",
"description": "Everything you need to know about sending and receiving emails.",
"products": ["thunderbird", "relay"],
"products": ["thunderbird", "thunderbird-android", "relay"],
},
{
"title": "Import and export email",
"slug": "import-and-export-email",
"description": "Import and export your emails for backup or transfer.",
"products": ["thunderbird"],
"products": ["thunderbird", "thunderbird-android"],
},
{
"title": "Calendar",
"slug": "calendar",
"description": "Manage your calendar events and schedules.",
"products": ["thunderbird"],
"products": ["thunderbird", "thunderbird-android"],
},
],
},
@ -712,8 +836,8 @@ TAXONOMY_MAPPING = [
{
"old_title": "Videos, sound, pictures and animations don't work",
"old_slug": "videos-sound-pictures-and-animations-dont-work",
"title": "Multimedia",
"slug": "multimedia",
"title": "Audio and video",
"slug": "audio-and-video",
"parent_topic_slug": "browse",
},
{
@ -1175,7 +1299,10 @@ def migrate_topics(apps, schema_editor):
for entry in TAXONOMY_MAPPING:
old_topics = Topic.objects.filter(slug=entry["old_slug"], product__isnull=False)
new_topic = Topic.objects.get(slug=entry["slug"], product__isnull=True)
try:
new_topic = Topic.objects.get(slug=entry["slug"], product__isnull=True)
except Topic.DoesNotExist:
continue
# we may have a list of topics with the same slug
for old_topic in old_topics: