#25466 closed Bug (fixed)
django.template.loader.LoaderOrigin was removed without proper deprecation
Reported by: | Joey Wilhelm | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | 1.9a1 |
Severity: | Release blocker | Keywords: | |
Cc: | Florian Apolloner | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
#15053 caused the removal of django.template.loader.LoadOrigin
(and django.template.StringOrigin
), in favor of django.template.base.Origin
, for Django 1.9.
These APIs were new and documented as of Django 1.7: https://docs.djangoproject.com/en/1.7/ref/templates/api/#template-origin
Even in the 1.8 branch, there is no DeprecationWarning for this class: https://github.com/django/django/blob/stable/1.8.x/django/template/loader.py#L14
Attachments (1)
Change History (12)
comment:1 by , 9 years ago
Cc: | added |
---|---|
Severity: | Normal → Release blocker |
comment:2 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 9 years ago
Description: | modified (diff) |
---|
May I ask about the use case so we can be sure to solve the issue appropriately? Thanks.
comment:4 by , 9 years ago
The case where I found it was in https://github.com/opbeat/opbeat_python/blob/131ecaa4829fa3155020e3f2c39c382fd1f8a08e/opbeat/contrib/django/client.py#L148. According to piquadrat, in #django:
< piquadrat> TheJoey: yep, that's probably the way it'll go. BTW, generally speaking, the change that introduced this is actually great for Opbeat because we now have the template name and can show you the template in the stack trace
by , 9 years ago
Attachment: | 25466-aliases.diff added |
---|
comment:5 by , 9 years ago
Would the attached patch solve your issue? A formal deprecation doesn't seem possible since you don't instantiate the class.
comment:6 by , 9 years ago
In the case of opbeat_python, it would solve the problem, but we anyway intend to use the Origin
class when available.
I searched github for LoaderOrigin
, there are a few occurrences, most prominently raven-python (Sentry), which is already updated to work with 1.9a1.
If possible we should restore the old aliases, after all this is a regression.