# HG changeset patch # User Lennard de Rijk # Date 1247589376 -7200 # Node ID c6d1c9ccef4a3ce05e5cb9f45c6131755d704ab3 # Parent 69ac7307bb50f37e0016307bdf163ed951df2221 Added button to the GradingRecords overview to send mail when updating projects. Note that this will mail all the projects for which a record is available. diff -r 69ac7307bb50 -r c6d1c9ccef4a app/soc/templates/soc/grading_survey_group/records.html --- a/app/soc/templates/soc/grading_survey_group/records.html Tue Jul 14 18:35:20 2009 +0200 +++ b/app/soc/templates/soc/grading_survey_group/records.html Tue Jul 14 18:36:16 2009 +0200 @@ -29,7 +29,10 @@ - + + + + diff -r 69ac7307bb50 -r c6d1c9ccef4a app/soc/views/models/grading_survey_group.py --- a/app/soc/views/models/grading_survey_group.py Tue Jul 14 18:35:20 2009 +0200 +++ b/app/soc/views/models/grading_survey_group.py Tue Jul 14 18:36:16 2009 +0200 @@ -289,7 +289,7 @@ fields = {'last_update_started': datetime.datetime.now()} survey_group_logic.updateEntityProperties(entity, fields) - context['message'] = 'Updating GradingRecords successfully started' + context['message'] = 'Updating GradingRecords successfully started.' if post_dict.get('update_projects'): # start the task to update all StudentProjects for the given group @@ -300,7 +300,22 @@ new_task = taskqueue.Task(params=task_params, url=task_url) new_task.add() - context['message'] = 'Updating StudentProjects successfully started' + context['message'] = 'Updating StudentProjects successfully started.' + + if post_dict.get('update_projects_and_mail'): + # Start the task to update all StudentProjects for the given group and + # send out emails. + task_params = { + 'group_key': entity.key().id_or_name(), + 'send_mail': 'true'} + task_url = '/tasks/grading_survey_group/update_projects' + + new_task = taskqueue.Task(params=task_params, url=task_url) + new_task.add() + + context['message'] = ('Updating StudentProjects successfully started. ' + 'And sending out e-mail with the results.') + list_params = params.copy() list_params['logic'] = record_logic