summaryrefslogtreecommitdiff
path: root/ishtar_common/views.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-09-10 18:02:50 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-09-10 18:02:50 +0200
commit05ed481007604079612aa4b0f1f3bb8d4d35a6e5 (patch)
treef84171501c3d98df394c94fcc6d32cc3dd5c6539 /ishtar_common/views.py
parent1d5254416b11ef1010d5ac31f2a53677254c6497 (diff)
downloadIshtar-05ed481007604079612aa4b0f1f3bb8d4d35a6e5.tar.bz2
Ishtar-05ed481007604079612aa4b0f1f3bb8d4d35a6e5.zip
Locks: prevent edit actions
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):