#36775: Raise ImproperlyConfigured when Feed.link is missing instead of failing
with AttributeError
-------------------------------------+-------------------------------------
Reporter: yureiblack | Owner:
Type: | yureiblack
Cleanup/optimization | Status: assigned
Component: contrib.syndication | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by VinayDattarao):
Hi, I’ve worked on this issue and implemented a fix.
Previously, when `Feed.link` was missing, it resulted in an
`AttributeError`. I’ve added an explicit check to ensure that `link` is
present (and handled whether it is callable or not). Now, if it is missing
or evaluates to an empty value, it raises `ImproperlyConfigured` with a
clear error message instead.
I’ve also verified that the change prevents the unintended
`AttributeError` and provides a more appropriate and developer-friendly
exception.
Please let me know if you’d like me to add or adjust tests for this
behavior before I open a PR.
--
Ticket URL: <https://code.djangoproject.com/ticket/36775#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019d1c0eb399-8e944d85-24d7-47fb-8973-6fd89d385c1c-000000%40eu-central-1.amazonses.com.