Commits

Richard Jones committed cf726f0

attempt to fix awards

Comments (0)

Files changed (1)

pyweek/challenge/views/award.py

         ), context_instance=RequestContext(request))
 
 class GiveAwardForm(forms.Form):
-    award = forms.ModelChoiceField()
+    award = forms.ModelChoiceField(models.Award)
 
 def give_award(request, entry_id):
     creator = request.user
     # Display form
     if request.method != 'POST':
         f = GiveAwardForm()
-        f.award.queryset = creator.award_set.all()
+        f.fields['award'].queryset = creator.award_set.all()
         return render_to_response('challenge/upload_award.html', info,
             context_instance=RequestContext(request))
 
     f = GiveAwardForm(request.POST)
-    f.award.queryset = creator.award_set.all()
+    f.fields['award'].queryset = creator.award_set.all()
     info['form'] = f
     if not f.is_valid():
         return render_to_response('challenge/upload_award.html', info,