UrlField.max_length is too short
See original GitHub issueWagtail is using the UrlField
provided by Django, which has max_length=200
. Sometimes this is not enough, especially for certain embeds.
Could we use a value larger than that for maybe all UrlField
s in Wagtail? Or what would be the best way to override this on a specific website?
Related to this, someone managed to submit a page with a long url without any validation errors, which then failed when publishing it. But the draft did get saved (along with the long url) but the page editor form didn’t render at all (because of an error when rendering the url field and TEMPLATE_DEBUG=False
). Changing the embed url field length directly in the database fixed this. Although this was an older version of Wagtail, so I’ll give it a try on 1.2 with richtext embeds and streamfield embed blocks too.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:17 (13 by maintainers)
I just ran into this exact problem and my google skills failed me before I opened up #6467. It’s essentially the same issue. The max_length constraint is currently preventing me from embedding instagram posts.
See also #4292:
In my opinion there shouldn’t be any length restriction on embed URLs. I don’t see the value in having that restriction to start with, and in many cases shortening the URL to make it comply simply isn’t an option.