Refs #31926 -- Fixed reverse related identity crash on Q() limit_choices_to.

This commit is contained in:
Simon Charette 2020-10-05 09:21:16 -04:00 committed by Mariusz Felisiak
parent 4c675523bd
commit 0ef04fdd7a
2 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ class ForeignObjectRel(FieldCacheMixin):
self.model,
self.related_name,
self.related_query_name,
tuple(sorted(make_hashable(self.limit_choices_to))),
make_hashable(self.limit_choices_to),
self.parent_link,
self.on_delete,
self.symmetrical,

View File

@ -37,7 +37,7 @@ class Group(models.Model):
class Event(models.Model):
title = models.CharField(max_length=100)
group = models.ForeignKey(Group, models.CASCADE)
group = models.ForeignKey(Group, models.CASCADE, limit_choices_to=models.Q())
class Happening(models.Model):