diff --git a/passbook/admin/templates/generic/create_inheritance.html b/passbook/admin/templates/generic/create_inheritance.html
new file mode 100644
index 000000000..eff352942
--- /dev/null
+++ b/passbook/admin/templates/generic/create_inheritance.html
@@ -0,0 +1,11 @@
+{% extends "generic/create.html" %}
+
+{% load i18n %}
+
+{% block title %}
+{% blocktrans with type=request.GET.type %}Create {{ type }}{% endblocktrans %}
+{% endblock %}
+
+{% block above_form %}
+
@@ -10,6 +10,7 @@
diff --git a/passbook/admin/views/rules.py b/passbook/admin/views/rules.py
index e8e0c169a..aa4917389 100644
--- a/passbook/admin/views/rules.py
+++ b/passbook/admin/views/rules.py
@@ -28,7 +28,7 @@ class RuleListView(AdminRequiredMixin, ListView):
class RuleCreateView(SuccessMessageMixin, AdminRequiredMixin, CreateView):
"""Create new Rule"""
- template_name = 'administration/rule/create.html'
+ template_name = 'generic/create_inheritance.html'
success_url = reverse_lazy('passbook_admin:rules')
success_message = _('Successfully created Rule')
@@ -55,18 +55,16 @@ class RuleUpdateView(SuccessMessageMixin, AdminRequiredMixin, UpdateView):
return form_class
def get_object(self, queryset=None):
- obj = Rule.objects.get(pk=self.kwargs.get('pk'))
- return obj.cast()
+ return Rule.objects.filter(pk=self.kwargs.get('pk')).select_subclasses().first()
class RuleDeleteView(SuccessMessageMixin, AdminRequiredMixin, DeleteView):
"""Delete rule"""
model = Rule
-
+ template_name = 'generic/delete.html'
success_url = reverse_lazy('passbook_admin:rules')
success_message = _('Successfully updated Rule')
def get_object(self, queryset=None):
- obj = Rule.objects.get(pk=self.kwargs.get('pk'))
- return obj.cast()
+ return Rule.objects.filter(pk=self.kwargs.get('pk')).select_subclasses().first()
diff --git a/passbook/admin/views/sources.py b/passbook/admin/views/sources.py
index f40b3c237..777289ff1 100644
--- a/passbook/admin/views/sources.py
+++ b/passbook/admin/views/sources.py
@@ -28,7 +28,7 @@ class SourceListView(AdminRequiredMixin, ListView):
class SourceCreateView(SuccessMessageMixin, AdminRequiredMixin, CreateView):
"""Create new Source"""
- template_name = 'administration/source/create.html'
+ template_name = 'generic/create_inheritance.html'
success_url = reverse_lazy('passbook_admin:sources')
success_message = _('Successfully created Source')