Skip to content

Commit

Permalink
CopyeditForm: fail if project has integrity errors.
Browse files Browse the repository at this point in the history
If a project has been submitted and is in "awaiting copyedit" stage,
and the project contains integrity errors (either because there are
errors that weren't caught at submission time, or because the editor
changed something that causes an error), then the editor should be
required to fix those errors before the project can be advanced to
"awaiting author approval".
  • Loading branch information
Benjamin Moody committed Aug 14, 2024
1 parent bca15af commit f457655
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions physionet-django/console/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ def __init__(self, *args, **kwargs):
def clean(self):
if self.errors:
return
project = self.instance.project
if not project.check_integrity():
raise forms.ValidationError(project.integrity_errors)
if self.cleaned_data['made_changes'] and not self.cleaned_data['changelog_summary']:
raise forms.ValidationError('Describe the changes you made.')
if not self.cleaned_data['made_changes'] and self.cleaned_data['changelog_summary']:
Expand Down

0 comments on commit f457655

Please sign in to comment.