From 29cb1113fd46fde6f3cf93a9742a92f094d10dd5 Mon Sep 17 00:00:00 2001 From: Asheesh Laroia Date: Sat, 14 Sep 2013 16:23:52 -0700 Subject: [PATCH] Make TrackerModel.get_by_name select subclasses This fixes an issue where the frontend would call get_by_name and then get something that it did not know how to deal with. Credit to John Morrissey for finding this one-line bug and writing paragraphs and paragraphs about it. Closes: https://openhatch.org/bugs/issue819 --- mysite/customs/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysite/customs/models.py b/mysite/customs/models.py index c704769c3e..b78f90d884 100644 --- a/mysite/customs/models.py +++ b/mysite/customs/models.py @@ -196,7 +196,7 @@ def get_by_name(cls, tracker_name): def _pipe_things(a, b): return a | b joined = reduce(_pipe_things, query_parts) - return cls.objects.get(joined) + return cls.objects.select_subclasses().get(joined) class TrackerQueryModel(models.Model): '''This model just exists to provide a way to grab a QuerySet