app/soc/views/models/grading_survey_group.py
changeset 2648 c6d1c9ccef4a
parent 2632 973e5e7ebd6e
child 2649 7faecb7f2765
--- 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