
import webapp2
import logging

from models import ActivityRecord


class TaskCalcImpact(webapp2.RequestHandler):

    """Force calculate of total_impact with a put()."""

    def get(self):
        """."""
        logging.info('tasks/calc_impact')

        activity_records = ActivityRecord.query()
        ar_count = 0
        for ar in activity_records:
            ar.put()
            ar_count += 1

        logging.info('tasks/calc_impact calculated %s ar' % ar_count)


import webapp2
import logging

from models import ActivityRecord


class TaskCalcImpact(webapp2.RequestHandler):

    """Force calculate of total_impact with a put()."""

    def get(self):
        """."""
        logging.info('tasks/calc_impact')

        activity_records = ActivityRecord.query()
        ar_count = 0
        for ar in activity_records:
            if ar.deleted is None:
                ar.deleted = False
            ar.put()
            ar_count += 1

        logging.info('tasks/calc_impact calculated %s ar' % ar_count)

Update TaskCalcImpact to also set deleted
Update TaskCalcImpact to also set deleted
  
  import webapp2
  import logging
  
  from models import ActivityRecord
  
  
  class TaskCalcImpact(webapp2.RequestHandler):
  
      """Force calculate of total_impact with a put()."""
  
      def get(self):
          """."""
          logging.info('tasks/calc_impact')
  
          activity_records = ActivityRecord.query()
          ar_count = 0
          for ar in activity_records:
+             if ar.deleted is None:
+                 ar.deleted = False
              ar.put()
              ar_count += 1
  
          logging.info('tasks/calc_impact calculated %s ar' % ar_count)
  
Update TaskCalcImpact to also set deleted
## Code Before:

import webapp2
import logging

from models import ActivityRecord


class TaskCalcImpact(webapp2.RequestHandler):

    """Force calculate of total_impact with a put()."""

    def get(self):
        """."""
        logging.info('tasks/calc_impact')

        activity_records = ActivityRecord.query()
        ar_count = 0
        for ar in activity_records:
            ar.put()
            ar_count += 1

        logging.info('tasks/calc_impact calculated %s ar' % ar_count)

## Instruction:
Update TaskCalcImpact to also set deleted
## Code After:

import webapp2
import logging

from models import ActivityRecord


class TaskCalcImpact(webapp2.RequestHandler):

    """Force calculate of total_impact with a put()."""

    def get(self):
        """."""
        logging.info('tasks/calc_impact')

        activity_records = ActivityRecord.query()
        ar_count = 0
        for ar in activity_records:
            if ar.deleted is None:
                ar.deleted = False
            ar.put()
            ar_count += 1

        logging.info('tasks/calc_impact calculated %s ar' % ar_count)
