diff --git a/scipost/forms.py b/scipost/forms.py index 6e86d1d46c6c7237b630e0a168b1be68dd5b9a71..172bedcc7df38bcd9fd15e31c67ce1dce0cdb117 100644 --- a/scipost/forms.py +++ b/scipost/forms.py @@ -67,9 +67,11 @@ class RegistrationInvitationForm(forms.ModelForm): {'placeholder': 'NOTE: a personal phrase or two. The bulk of the text will be auto-generated.'}) self.fields['cited_in_submission'] = forms.ModelChoiceField( queryset=Submission.objects.all().exclude( - status__in=SUBMISSION_STATUS_PUBLICLY_UNLISTED).order_by('-submission_date')) + status__in=SUBMISSION_STATUS_PUBLICLY_UNLISTED).order_by('-submission_date'), + required=False) self.fields['cited_in_publication'] = forms.ModelChoiceField( - queryset=Publication.objects.all().order_by('-publication_date')) + queryset=Publication.objects.all().order_by('-publication_date'), + required=False) self.helper = FormHelper() self.helper.layout = Layout( Div( diff --git a/scipost/views.py b/scipost/views.py index e56bf12b0fcf1155877c99459fdd8bc7067ef82a..81425908c623e2cfa6622ee7ae49ef2aa67b5e8d 100644 --- a/scipost/views.py +++ b/scipost/views.py @@ -465,6 +465,9 @@ def registration_invitations(request): Utils.create_invitation() Utils.send_registration_invitation_email() return HttpResponseRedirect('registration_invitation_sent') + else: + errormessage = 'The form was not filled validly.' + else: reg_inv_form = RegistrationInvitationForm()