File tree 1 file changed +2
-5
lines changed
1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -650,18 +650,15 @@ def getResponseData(self, form):
650
650
elif generic_fields [ftype ]['typeMap' ] is not DummyField :
651
651
response_data ['questions' ].append ([qname , field ['label' ], ftype ])
652
652
653
- users = ESPUser .objects .filter (id__in = map (lambda response : response ['user_id' ], responses )).distinct ()
654
- users_dict = {}
655
- for user in users :
656
- users_dict [user .id ] = user
653
+ users = ESPUser .objects .in_bulk (map (lambda response : response ['user_id' ], responses ))
657
654
658
655
# Now let's set up the responses
659
656
for response in responses :
660
657
link_instances_cache = {}
661
658
662
659
# Add in user if form is not anonymous
663
660
if not form .anonymous :
664
- user = users_dict [response ['user_id' ]]
661
+ user = users [response ['user_id' ]]
665
662
response ['user_id' ] = unicode (response ['user_id' ])
666
663
response ['user_display' ] = user .name ()
667
664
response ['user_email' ] = user .email
You can’t perform that action at this time.
0 commit comments