from flask import request
from pybossa.model.project_stats import ProjectStats
from api_base import APIBase


class ProjectStatsAPI(APIBase):

    """Class for domain object ProjectStats."""

    __class__ = ProjectStats

    def _select_attributes(self, stats_data):
        if request.args.get('full'):
            return stats_data
        stats_data['info'].pop('hours_stats', None)
        stats_data['info'].pop('dates_stats', None)
        stats_data['info'].pop('users_stats', None)
        return stats_data

import copy
from flask import request
from pybossa.model.project_stats import ProjectStats
from api_base import APIBase


class ProjectStatsAPI(APIBase):

    """Class for domain object ProjectStats."""

    __class__ = ProjectStats

    def _select_attributes(self, stats_data):
        if not request.args.get('full'):
            tmp = copy.deepcopy(stats_data)
            tmp['info'].pop('hours_stats', None)
            tmp['info'].pop('dates_stats', None)
            tmp['info'].pop('users_stats', None)
            return tmp
        return stats_data

Fix _select_attributes from project api
Fix _select_attributes from project api

+ import copy
  from flask import request
  from pybossa.model.project_stats import ProjectStats
  from api_base import APIBase
  
  
  class ProjectStatsAPI(APIBase):
  
      """Class for domain object ProjectStats."""
  
      __class__ = ProjectStats
  
      def _select_attributes(self, stats_data):
-         if request.args.get('full'):
+         if not request.args.get('full'):
-             return stats_data
+             tmp = copy.deepcopy(stats_data)
-         stats_data['info'].pop('hours_stats', None)
+             tmp['info'].pop('hours_stats', None)
-         stats_data['info'].pop('dates_stats', None)
+             tmp['info'].pop('dates_stats', None)
-         stats_data['info'].pop('users_stats', None)
+             tmp['info'].pop('users_stats', None)
+             return tmp
          return stats_data
  
Fix _select_attributes from project api
## Code Before:
from flask import request
from pybossa.model.project_stats import ProjectStats
from api_base import APIBase


class ProjectStatsAPI(APIBase):

    """Class for domain object ProjectStats."""

    __class__ = ProjectStats

    def _select_attributes(self, stats_data):
        if request.args.get('full'):
            return stats_data
        stats_data['info'].pop('hours_stats', None)
        stats_data['info'].pop('dates_stats', None)
        stats_data['info'].pop('users_stats', None)
        return stats_data

## Instruction:
Fix _select_attributes from project api
## Code After:
import copy
from flask import request
from pybossa.model.project_stats import ProjectStats
from api_base import APIBase


class ProjectStatsAPI(APIBase):

    """Class for domain object ProjectStats."""

    __class__ = ProjectStats

    def _select_attributes(self, stats_data):
        if not request.args.get('full'):
            tmp = copy.deepcopy(stats_data)
            tmp['info'].pop('hours_stats', None)
            tmp['info'].pop('dates_stats', None)
            tmp['info'].pop('users_stats', None)
            return tmp
        return stats_data
