Esempio n. 1
0
from soc.models.host import Host
from soc.models.role import Role

from soc.modules.gci.logic import task as task_logic
from soc.modules.gci.models.comment import GCIComment
from soc.modules.gci.models.mentor import GCIMentor
from soc.modules.gci.models.org_admin import GCIOrgAdmin
from soc.modules.gci.models.profile import GCIProfile
from soc.modules.gci.models.student import GCIStudent
from soc.modules.gci.models.task import GCITask
from soc.modules.gci.models.task_subscription import GCITaskSubscription
from soc.modules.gci.models.work_submission import GCIWorkSubmission


TASK_PROPERTIES = GCITask.properties()
# We do not want history property in the new entities in any more because
# we are not using it
TASK_PROPERTIES.pop('scope', 'history')

COMMENT_PROPERTIES = GCIComment.properties()
WORK_SUBMISSION_PROPERTIES = GCIWorkSubmission.properties()


def process_task(task):
  """Conversion to make GCI Tasks ID based and getting rid of unnecessary
  properties.
  """
  if task.key().name():
    # Get the values for all the properties in the GCITask model from the
    # old entity to create the new entity.