X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/d606942f6eb286933eb71f4232db580fcb3a166c..ac21bdd330d4f33ec70509695f55bf65d8af0427:/apps/sponsors/widgets.py?ds=inline

diff --git a/apps/sponsors/widgets.py b/apps/sponsors/widgets.py
index fc1387323..0ddab3809 100644
--- a/apps/sponsors/widgets.py
+++ b/apps/sponsors/widgets.py
@@ -23,7 +23,7 @@ class SponsorPageWidget(forms.Textarea):
 
     def render(self, name, value, attrs=None):
         output = [super(SponsorPageWidget, self).render(name, value, attrs)]
-        sponsors = [(unicode(obj), obj.pk, obj.logo.url) for obj in models.Sponsor.objects.all()]
+        sponsors = [(unicode(obj), obj.pk, obj.logo.url) for obj in models.Sponsor.objects.all().iterator()]
         sponsors_js = ', '.join('{name: "%s", id: %d, image: "%s"}' % sponsor for sponsor in sponsors)
         output.append(u'<script type="text/javascript">addEvent(window, "load", function(e) {')
         # TODO: "id_" is hard-coded here. This should instead use the correct