Skip to content

Commit

Permalink
Make TrackerModel.get_by_name select subclasses
Browse files Browse the repository at this point in the history
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
  • Loading branch information
paulproteus committed Sep 14, 2013
1 parent 742038a commit 29cb111
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mysite/customs/models.py
Expand Up @@ -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
Expand Down

0 comments on commit 29cb111

Please sign in to comment.