fix: address review feedback — URLField→CharField, safe reverse migration
All checks were successful
CI / nightly-e2e (pull_request) Has been skipped
CI / deploy (pull_request) Has been skipped
CI / pr-e2e (pull_request) Successful in 1m14s
CI / ci (pull_request) Successful in 1m20s

- Change SocialMediaLink.url and NavigationMenuItem.link_url from
  URLField to CharField(max_length=500) to support internal paths
  like /feed/ that fail URLField validation
- Replace destructive reverse_seed (deleted ALL rows) with
  RunPython.noop to prevent data loss on rollback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Mark
2026-03-02 19:36:27 +00:00
parent 1c5ba6cf90
commit d3687779a2
3 changed files with 28 additions and 11 deletions

View File

@@ -85,10 +85,11 @@ class NavigationMenuItem(Orderable):
related_name="+",
help_text="Link to an internal page. If unpublished, the link is hidden automatically.",
)
link_url = models.URLField(
link_url = models.CharField(
max_length=500,
blank=True,
default="",
help_text="External URL (used only when no page is selected).",
help_text="URL or path (used only when no page is selected).",
)
link_title = models.CharField(
max_length=100,
@@ -144,7 +145,7 @@ class SocialMediaLink(Orderable):
max_length=30,
choices=SOCIAL_ICON_CHOICES,
)
url = models.URLField()
url = models.CharField(max_length=500, help_text="URL or path (e.g. https://twitter.com/… or /feed/).")
label = models.CharField(
max_length=100,
blank=True,