Skip to content

Commit

Permalink
[bug 824968] Fix models undefined in monkeypatch.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlr committed Jan 3, 2013
1 parent ada2941 commit e57809c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/sumo/monkeypatch.py
Expand Up @@ -55,6 +55,7 @@ class EmailWidget(fields.EmailField.widget):
# Workaround until https://code.djangoproject.com/ticket/16920 gets fixed.
from django.contrib.admin import util
from django.contrib.admin.util import NestedObjects
from django.db import models

def _collect(self, objs, source_attr=None, **kwargs):
for obj in objs:
Expand All @@ -67,7 +68,7 @@ def _collect(self, objs, source_attr=None, **kwargs):
try:
return super(NestedObjects, self).collect(
objs, source_attr=source_attr, **kwargs)
except models.ProtectedError, e:
except models.ProtectedError as e:
self.protected.update(e.protected_objects)

util.NestedObjects.collect = _collect

0 comments on commit e57809c

Please sign in to comment.