зеркало из https://github.com/mozilla/kitsune.git
Merge pull request #6157 from akatsoulas/delete-existing-redirect
Delete existing redirects if slug exists in taxonomy.
This commit is contained in:
Коммит
219caad09f
|
@ -528,8 +528,11 @@ def migrate_topics(apps, schema_editor):
|
||||||
slug=entry["old_slug"], defaults={"topic": new_topic}
|
slug=entry["old_slug"], defaults={"topic": new_topic}
|
||||||
)
|
)
|
||||||
if not created:
|
if not created:
|
||||||
topic_slug.topic = new_topic
|
if topic_slug.slug == new_topic.slug:
|
||||||
topic_slug.save()
|
topic_slug.delete()
|
||||||
|
else:
|
||||||
|
topic_slug.topic = new_topic
|
||||||
|
topic_slug.save()
|
||||||
|
|
||||||
# Archive the old topic
|
# Archive the old topic
|
||||||
old_topic.is_archived = True
|
old_topic.is_archived = True
|
||||||
|
|
Загрузка…
Ссылка в новой задаче