diff --git a/theses/forms.py b/theses/forms.py index 5b8b8db4cecc499e9d8a4006b1b98face3e2d0d8..c8a890ddce4a432529ab9ef12e41409a626f8ba4 100644 --- a/theses/forms.py +++ b/theses/forms.py @@ -42,6 +42,10 @@ class VetThesisLinkForm(RequestThesisLinkForm): justification = forms.CharField(widget=forms.Textarea( attrs={'rows': 5, 'cols': 40}), label='Justification (optional)', required=False) + def __init__(self, *args, **kwargs): + super(VetThesisLinkForm, self).__init__(*args, **kwargs) + self.order_fields(['action_option', 'refusal_reason', 'justification']) + def vet_request(self, thesislink, user): if int(self.cleaned_data['action_option']) == VetThesisLinkForm.ACCEPT: thesislink.vetted = True diff --git a/theses/views.py b/theses/views.py index 34c9f035e737fb1aea998b2530b806184b105746..858e8c33d6a80f79da959a55f93f2716c40e4348 100644 --- a/theses/views.py +++ b/theses/views.py @@ -38,6 +38,7 @@ class RequestThesisLink(CreateView): success_url = reverse_lazy('scipost:personal_page') def form_valid(self, form): + form.instance.requested_by = self.request.user.contributor messages.add_message(self.request, messages.SUCCESS, strings.acknowledge_request_thesis_link) return super(RequestThesisLink, self).form_valid(form)