diff --git a/apps/complaints/forms.py b/apps/complaints/forms.py index 937ab26..aae7680 100644 --- a/apps/complaints/forms.py +++ b/apps/complaints/forms.py @@ -904,7 +904,7 @@ class EscalationRuleForm(HospitalFieldMixin, forms.ModelForm): pass elif self.initial.get("hospital"): hospital = self.initial.get("hospital") - elif self.instance and self.instance.pk and self.instance.hospital: + elif self.instance and self.instance.pk and self.instance.hospital_id: hospital = self.instance.hospital elif self.user and self.user.is_px_admin(): hospital = getattr(self.request, "tenant_hospital", None) diff --git a/apps/complaints/ui_views_oncall.py b/apps/complaints/ui_views_oncall.py index a180584..1eb2e59 100644 --- a/apps/complaints/ui_views_oncall.py +++ b/apps/complaints/ui_views_oncall.py @@ -29,7 +29,7 @@ def check_px_admin(request): """Check if user is PX Admin, return redirect if not.""" if not request.user.is_px_admin(): messages.error(request, _("You do not have permission to access this page.")) - return redirect("dashboard") + return redirect("/") return None diff --git a/templates/complaints/templates/template_form.html b/templates/complaints/templates/template_form.html new file mode 100644 index 0000000..04aaf80 --- /dev/null +++ b/templates/complaints/templates/template_form.html @@ -0,0 +1,63 @@ +{% extends "layouts/base.html" %} +{% load i18n %} + +{% block title %}{% if template %}{% trans "Edit Template" %}{% else %}{% trans "New Template" %}{% endif %} - PX360{% endblock %} + +{% block content %} +
+
+
+ {% trans "Templates" %} + + {% if template %}{% trans "Edit" %}{% else %}{% trans "New" %}{% endif %} +
+

{% if template %}{% trans "Edit Template" %}{% else %}{% trans "Create Template" %}{% endif %}

+
+ +
+
+ {% csrf_token %} + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + {% trans "Cancel" %} + +
+
+
+
+{% endblock %}