# Path: harnas/contest/helpers.py
# def copy_directory(src, dest):
# def save_task(task):
# def get_task_dir(task_id):
# def save_testcase_file(file, dest_dir):


import os
import shutil
from django.conf import settings
from django.contrib.auth.models import Group, User
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from harnas.contest import helpers
    max_solution_size = models.PositiveIntegerField()

    # Default timestamps values for task. Can be overridden individually in
    # groups. See GroupsTaskDetails.
    open = models.DateTimeField(null=True, default=None)
    deadline = models.DateTimeField(null=True, default=None)
    close = models.DateTimeField(null=True, default=None)

    class Meta:
        permissions = (
            ('view_task', 'Can view task'),
            ('submit_solution', 'Can submit solution'),
            ('edit_task', 'Can edit task'))

    def __str__(self):
        return self.name

    @property
    def display_name(self):
        if self.contest is not None and self.contest.name.strip() != "":
            return "%s (%s)" % (self.name, self.contest.name)
        else:
            return self.name


class TaskFilesDirectoryError(Exception):
    pass


@receiver(post_save,

# Path: harnas/contest/helpers.py
# def copy_directory(src, dest):
# def save_task(task):
# def get_task_dir(task_id):
# def save_testcase_file(file, dest_dir):


# Path: harnas/contest/models.py
import os
import shutil
from django.conf import settings
from django.contrib.auth.models import Group, User
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from harnas.contest import helpers

    max_solution_size = models.PositiveIntegerField()

    # Default timestamps values for task. Can be overridden individually in
    # groups. See GroupsTaskDetails.
    open = models.DateTimeField(null=True, default=None)
    deadline = models.DateTimeField(null=True, default=None)
    close = models.DateTimeField(null=True, default=None)

    class Meta:
        permissions = (
            ('view_task', 'Can view task'),
            ('submit_solution', 'Can submit solution'),
            ('edit_task', 'Can edit task'))

    def __str__(self):
        return self.name

    @property
    def display_name(self):
        if self.contest is not None and self.contest.name.strip() != "":
            return "%s (%s)" % (self.name, self.contest.name)
        else:
            return self.name


class TaskFilesDirectoryError(Exception):
    pass


@receiver(post_save,

          sender=Task,