diff --git a/submissions/views.py b/submissions/views.py index 28008f7149a6a0f279343c29bd0c15a7fdf8a002..a754173b873e3be4752167567e08df1a05f7b920 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -409,6 +409,8 @@ def submission_detail_wo_vn_nr(request, identifier_wo_vn_nr): submissions = get_list_or_404( Submission, preprint__identifier_w_vn_nr__startswith=identifier_wo_vn_nr) latest = submissions[0].get_latest_version() + if not latest: # this can happen if there exists no public version in this thread + raise Http404 return redirect(reverse('submissions:submission', kwargs={ 'identifier_w_vn_nr': latest.preprint.identifier_w_vn_nr }))