Refactor approval queue to display last meaningful status #94
@ -4,6 +4,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
|
|||||||
from django.contrib.messages.views import SuccessMessageMixin
|
from django.contrib.messages.views import SuccessMessageMixin
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
from django.shortcuts import get_object_or_404, reverse
|
from django.shortcuts import get_object_or_404, reverse
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
from django.views.generic import DetailView, ListView
|
from django.views.generic import DetailView, ListView
|
||||||
from django.views.generic.edit import CreateView, UpdateView, DeleteView, FormView
|
from django.views.generic.edit import CreateView, UpdateView, DeleteView, FormView
|
||||||
|
|
||||||
@ -358,6 +359,7 @@ class DraftExtensionView(
|
|||||||
):
|
):
|
||||||
template_name = 'extensions/draft_finalise.html'
|
template_name = 'extensions/draft_finalise.html'
|
||||||
form_class = VersionForm
|
form_class = VersionForm
|
||||||
|
msg_awaiting_review = _('Extension is ready for initial review')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def success_message(self) -> str:
|
def success_message(self) -> str:
|
||||||
@ -423,7 +425,7 @@ class DraftExtensionView(
|
|||||||
user=self.request.user,
|
user=self.request.user,
|
||||||
extension=extension_form.instance,
|
extension=extension_form.instance,
|
||||||
type=ApprovalActivity.ActivityType.AWAITING_REVIEW,
|
type=ApprovalActivity.ActivityType.AWAITING_REVIEW,
|
||||||
message="initial submission",
|
message=self.msg_awaiting_review,
|
||||||
).save()
|
).save()
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
except forms.ValidationError as e:
|
except forms.ValidationError as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user