Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion api/preprints/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def update(self, preprint, validated_data):

updated_has_prereg_links = validated_data.get('has_prereg_links', preprint.has_prereg_links)
updated_why_no_prereg = validated_data.get('why_no_prereg', preprint.why_no_prereg)
prereg_links = validated_data.get('prereg_links', preprint.prereg_links)

if updated_has_coi is False and updated_conflict_statement:
raise exceptions.ValidationError(
Expand All @@ -341,7 +342,7 @@ def update(self, preprint, validated_data):
detail='Cannot provide data links when has_data_links is set to "no".',
)

if updated_has_prereg_links != 'no' and updated_why_no_prereg:
if updated_has_prereg_links != 'no' and (updated_why_no_prereg and not prereg_links):
raise exceptions.ValidationError(
detail='You cannot edit this statement while your prereg links availability is set to true or is unanswered.',
)
Expand Down
Loading