Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#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 Tim Graham)

#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)

25466-aliases.diff (1.0 KB ) - added by Tim Graham 9 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by Florian Apolloner, 9 years ago

Cc: Florian Apolloner added
Severity: NormalRelease blocker

If possible we should restore the old aliases, after all this is a regression.

comment:2 by Florian Apolloner, 9 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Tim Graham, 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 Joey Wilhelm, 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 Tim Graham, 9 years ago

Attachment: 25466-aliases.diff added

comment:5 by Tim Graham, 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 Benjamin Wohlwend, 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.

comment:7 by Tim Graham, 9 years ago

Has patch: set

comment:8 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In 8d1a001:

Fixed #25466 -- Added backwards compatibility aliases for LoaderOrigin and StringOrigin.

Thanks Simon Charette for the DeprecationInstanceCheck class.

comment:9 by Tim Graham <timograham@…>, 9 years ago

In 59027a4c:

[1.9.x] Fixed #25466 -- Added backwards compatibility aliases for LoaderOrigin and StringOrigin.

Thanks Simon Charette for the DeprecationInstanceCheck class.

Backport of 8d1a001ef6dcbbe8053da05cdb3ec99965b0953f from master

comment:10 by Tim Graham <timograham@…>, 7 years ago

In ff419de2:

Refs #25466 -- Removed aliases for LoaderOrigin and StringOrigin.

Per deprecation timeline.

Note: See TracTickets for help on using tickets.
Back to Top