Changeset - 8df76219f804
[Not reviewed]
0 1 0
Bradley Kuhn (bkuhn) - 6 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 4 insertions and 1 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:
 
            returnDict[code][kk] = getattr(code, kk)
 
            if hasattr(code, kk):
 
                returnDict[code][kk] = getattr(code, kk)
 

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