# HG changeset patch # User Lennard de Rijk # Date 1251150768 -7200 # Node ID dd841c3160d8a874075525897694bd40b8e25885 # Parent 8c88226b27e73dccaeee58254611838e866143da Only create GradingRecords for succeful projects or failed projects with Surveys. This is done because it has no use to create new GradingRecords for already failed/invalid projects because the outcome of this one will have no changing effect on the status. diff -r 8c88226b27e7 -r dd841c3160d8 app/soc/logic/models/grading_record.py --- a/app/soc/logic/models/grading_record.py Mon Aug 24 18:44:41 2009 +0200 +++ b/app/soc/logic/models/grading_record.py Mon Aug 24 23:52:48 2009 +0200 @@ -67,6 +67,13 @@ survey_group, record_entity) + if not record_entity and project_entity.status in ['failed', 'invalid'] \ + and not record_fields['mentor_record'] \ + and not record_fields['student_record']: + # Don't create a new GradingRecord for an already failed project which + # has no records attached. Because it does not matter. + continue + if record_entity: # update existing GradingRecord for key,value in record_fields.iteritems():