Changeset - 8df76219f804
[Not reviewed]
0 1 0
Bradley Kuhn (bkuhn) - 9 years ago 2015-05-10 00:29:08
bkuhn@ebb.org
Get an empty dict & no error when attrs not there
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/fundgoal/views.py
Show inline comments
...
 
@@ -14,6 +14,9 @@ def view(request):
 

	
 
    returnDict = {}
 
    for code in FundraisingGoal.objects.filter(fundraiser_code_name__in=codeNames):
 
        returnDict[code] = {}
 
        for kk in keysForJSON:
 
            if hasattr(code, kk):
 
                returnDict[code][kk] = getattr(code, kk)
 

	
 
    return JsonResponse( returnDict)
0 comments (0 inline, 0 general)