Commit bc65fae4 authored by Jens Langhammer's avatar Jens Langhammer

Admin: remove .cast() calls and replace with select_subclasses()

parent 005d0f1c
......@@ -54,8 +54,7 @@ class SourceUpdateView(SuccessMessageMixin, AdminRequiredMixin, UpdateView):
return form_class
def get_object(self, queryset=None):
obj = Source.objects.get(pk=self.kwargs.get('pk'))
return obj.cast()
return Source.objects.filter(pk=self.kwargs.get('pk')).select_subclasses().first()
class SourceDeleteView(SuccessMessageMixin, AdminRequiredMixin, DeleteView):
......@@ -67,5 +66,4 @@ class SourceDeleteView(SuccessMessageMixin, AdminRequiredMixin, DeleteView):
success_message = _('Successfully updated Source')
def get_object(self, queryset=None):
obj = Source.objects.get(pk=self.kwargs.get('pk'))
return obj.cast()
return Source.objects.filter(pk=self.kwargs.get('pk')).select_subclasses().first()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment