MIT-LCP / physionet-build

The new PhysioNet platform.

Home Page:https://physionet.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ArchivedProject should be removed

tompollard opened this issue · comments

The ArchivedProject object stores information about ActiveProjects that are deleted or rejected:

class ArchivedProject(Metadata, UnpublishedProject, SubmissionInfo):
"""
An archived project. Created when (maps to archive_reason):
1. A user chooses to 'delete' their ActiveProject.
2. An ActiveProject is not submitted for too long.
3. An ActiveProject is submitted and rejected.
4. An ActiveProject is submitted and times out.
"""
archive_datetime = models.DateTimeField(auto_now_add=True)
archive_reason = models.PositiveSmallIntegerField()
# Subdirectory (under self.files.file_root) where files are stored
FILE_STORAGE_SUBDIR = 'archived-projects'
class Meta:
default_permissions = ('change',)
def __str__(self):
return ('{0} v{1}'.format(self.title, self.version))

There are a couple of major issues with the implementation of ArchivedProject:

  1. Converting from an ActiveProject to an ArchivedProject is a one way process (i.e. it isn't possible to resurrect a project that has been deleted or rejected). As a result, editors will almost never "reject" a submission for fear of losing the content (see: #2116).
  2. There are a bunch of objects (e.g. References, Authors, EditLogs) that need to point to both ActiveProject and ArchivedProject. Our solution is to use GenericForeignKeys, which are difficult to work with (see: #1496).

I have mostly implemented a switch from ArchivedProject to ActiveProject by adding a new ARCHIVED submission status to the ActiveProject. In making the change, it has become clear that we don't have a clear approach for tracking events over the life of a project, so I can't see a clean way of logging the rejection or deletion of a project.