summaryrefslogtreecommitdiff
path: root/ishtar_common/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/views.py')
-rw-r--r--ishtar_common/views.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index 2af082a0a..4ab94aae9 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -2110,6 +2110,17 @@ class AlertList(JSONResponseMixin, LoginRequiredMixin,
return {'alerts': alerts}
+class QANotAvailable(IshtarMixin, LoginRequiredMixin, TemplateView):
+ template_name = 'ishtar/forms/qa_message.html'
+ modal_size = "small"
+
+ def get_context_data(self, **kwargs):
+ data = super(QANotAvailable, self).get_context_data(**kwargs)
+ data["page_name"] = _("Not available")
+ data['message'] = _("Action not available for these items.")
+ return data
+
+
class QAItemForm(IshtarMixin, LoginRequiredMixin, FormView):
template_name = 'ishtar/forms/qa_form.html'
model = None
@@ -2168,6 +2179,10 @@ class QAItemEditForm(QAItemForm):
self.confirm = kwargs.get('confirm', False) and True
returned = super(QAItemEditForm, self).dispatch(request, *args,
**kwargs)
+ if hasattr(self.model, "locked"):
+ for item in self.items:
+ if item.locked:
+ return HttpResponseRedirect(reverse("qa-not-available"))
return returned
def get_form_class(self):