1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

[1.5.x] Fixed #20278 -- ensured .get() exceptions do not recurse infinitely

A regression caused by d5b93d3281 made .get() error
reporting recurse infinitely on certain rare conditions. Fixed this by
not trying to print the given lookup kwargs.

Backpatch of 266c0bb23e
This commit is contained in:
Anssi Kääriäinen
2013-05-20 18:45:24 +03:00
parent 367089a846
commit 0eddedf7db
3 changed files with 21 additions and 20 deletions

View File

@@ -18,3 +18,11 @@ class Article(models.Model):
def __str__(self):
return self.headline
@python_2_unicode_compatible
class SelfRef(models.Model):
selfref = models.ForeignKey('self', null=True, blank=True,
related_name='+')
def __str__(self):
return SelfRef.objects.get(selfref=self).pk