app/soc/views/models/grading_survey_group.py
changeset 2650 6adbb87b91db
parent 2649 7faecb7f2765
child 2651 842c0f11fc1e
equal deleted inserted replaced
2649:7faecb7f2765 2650:6adbb87b91db
   287 
   287 
   288       # update the GradingSurveyGroup with the new timestamp
   288       # update the GradingSurveyGroup with the new timestamp
   289       fields = {'last_update_started': datetime.datetime.now()}
   289       fields = {'last_update_started': datetime.datetime.now()}
   290       survey_group_logic.updateEntityProperties(entity, fields)
   290       survey_group_logic.updateEntityProperties(entity, fields)
   291 
   291 
   292       context['message'] = 'Updating GradingRecords successfully started.'
   292       context['message'] = 'Grading Records update successfully started.'
   293 
   293 
   294     if post_dict.get('update_projects'):
   294     if post_dict.get('update_projects'):
   295       # start the task to update all StudentProjects for the given group
   295       # start the task to update all StudentProjects for the given group
   296       task_params = {
   296       task_params = {
   297           'group_key': entity.key().id_or_name()}
   297           'group_key': entity.key().id_or_name()}
   298       task_url = '/tasks/grading_survey_group/update_projects'
   298       task_url = '/tasks/grading_survey_group/update_projects'
   299 
   299 
   300       new_task = taskqueue.Task(params=task_params, url=task_url)
   300       new_task = taskqueue.Task(params=task_params, url=task_url)
   301       new_task.add()
   301       new_task.add()
   302 
   302 
   303       context['message'] = 'Updating StudentProjects successfully started.'
   303       context['message'] = 'Student Projects update successfully started.'
   304 
   304 
   305     if post_dict.get('update_projects_and_mail'):
   305     if post_dict.get('update_projects_and_mail'):
   306       # Start the task to update all StudentProjects for the given group and
   306       # Start the task to update all StudentProjects for the given group and
   307       # send out emails.
   307       # send out emails.
   308       task_params = {
   308       task_params = {
   311       task_url = '/tasks/grading_survey_group/update_projects'
   311       task_url = '/tasks/grading_survey_group/update_projects'
   312 
   312 
   313       new_task = taskqueue.Task(params=task_params, url=task_url)
   313       new_task = taskqueue.Task(params=task_params, url=task_url)
   314       new_task.add()
   314       new_task.add()
   315 
   315 
   316       context['message'] = ('Updating StudentProjects successfully started. '
   316       context['message'] = ('Student Projects update successfully started. '
   317                            'And sending out e-mail with the results.')
   317                             'And sending out e-mail with the results.')
   318 
   318 
   319     list_params = params.copy()
   319     list_params = params.copy()
   320     list_params['logic'] = record_logic
   320     list_params['logic'] = record_logic
   321     list_params['list_heading'] = params['records_heading_template']
   321     list_params['list_heading'] = params['records_heading_template']
   322     list_params['list_row'] = params['records_row_template']
   322     list_params['list_row'] = params['records_row_template']