Skip to content

Commit 2b77360

Browse files
authored
Allow creating a new version after previous submission is archived (#2382)
If you are the submitting author of a published project: - Go to your Project Home. - Click "New Version" and create a new version. - Go to the overview page for the new version. - Click "Delete Project" and confirm. - Return to your Project Home. - You are now incapable of creating another new version. Likewise, if you create a new version and submit it, and it is rejected, you will be incapable of creating another new version. This was an unintended consequence of adding ARCHIVED as a submission status and removing ArchivedProjects (see pull #2149 and #2170).
2 parents f315bfa + b5b33f8 commit 2b77360

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

physionet-django/project/modelcomponents/coreproject.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
from django.core.validators import MaxValueValidator, MinValueValidator
44
from django.db import models
55

6-
from project.modelcomponents.activeproject import ActiveProject
6+
from project.modelcomponents.activeproject import (
7+
ActiveProject,
8+
SubmissionStatus,
9+
)
710
from project.modelcomponents.publishedproject import PublishedProject
811

912

@@ -27,7 +30,9 @@ class Meta:
2730

2831
def active_new_version(self):
2932
"Whether there is a new version being worked on"
30-
return bool(self.activeprojects.filter())
33+
return self.activeprojects.exclude(
34+
submission_status=SubmissionStatus.ARCHIVED
35+
).exists()
3136

3237
def get_published_versions(self):
3338
"""

0 commit comments

Comments
 (0)