1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

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.
This commit is contained in:
Anssi Kääriäinen
2013-05-20 18:45:24 +03:00
parent c9a96075fa
commit 266c0bb23e
3 changed files with 22 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