diff --git a/opentech/apply/activity/messaging.py b/opentech/apply/activity/messaging.py index ead826634dd5ce42f53996566f6ce3c35a895301..b2679fae0d49b87381d08f0df87bfd4775d350c8 100644 --- a/opentech/apply/activity/messaging.py +++ b/opentech/apply/activity/messaging.py @@ -128,7 +128,7 @@ class ActivityAdapter(AdapterBase): MESSAGES.REVIEWERS_UPDATED: 'reviewers_updated', MESSAGES.NEW_REVIEW: 'Submitted a review', MESSAGES.OPENED_SEALED: 'Opened the submission while still sealed', - MESSAGES.SCREENING: 'Screening status {old_status} to {submission.screening_status}' + MESSAGES.SCREENING: 'Screening status from {old_status} to {submission.screening_status}' } def recipients(self, message_type, **kwargs): diff --git a/opentech/apply/funds/views.py b/opentech/apply/funds/views.py index 70d5521aefeb92d50c41654d28250767703dcc0b..152a144866f36bf6d5b6d1835f17fda9afce7151 100644 --- a/opentech/apply/funds/views.py +++ b/opentech/apply/funds/views.py @@ -98,22 +98,17 @@ class ScreeningSubmissionView(DelegatedViewMixin, UpdateView): def form_valid(self, form): screening_status = form.cleaned_data.get('screening_status') - old_status = copy(self.get_object()).screening_status - if old_status: - old_status = f'set from {old_status}' - else: - old_status = 'set' - self.object.screening_status = screening_status - self.object.save(update_fields=['screening_status']) + old = copy(self.get_object()) + response = super().form_valid(form) # Record activity messenger( MESSAGES.SCREENING, request=self.request, user=self.request.user, submission=self.object, - related=old_status, + related=old.screening_status or '-', ) - return super().form_valid(form) + return response @method_decorator(staff_required, name='dispatch')