Admin: remove .cast() calls and replace with select_subclasses()
This commit is contained in:
parent
005d0f1c8f
commit
bc65fae4b2
|
@ -54,8 +54,7 @@ class SourceUpdateView(SuccessMessageMixin, AdminRequiredMixin, UpdateView):
|
||||||
return form_class
|
return form_class
|
||||||
|
|
||||||
def get_object(self, queryset=None):
|
def get_object(self, queryset=None):
|
||||||
obj = Source.objects.get(pk=self.kwargs.get('pk'))
|
return Source.objects.filter(pk=self.kwargs.get('pk')).select_subclasses().first()
|
||||||
return obj.cast()
|
|
||||||
|
|
||||||
|
|
||||||
class SourceDeleteView(SuccessMessageMixin, AdminRequiredMixin, DeleteView):
|
class SourceDeleteView(SuccessMessageMixin, AdminRequiredMixin, DeleteView):
|
||||||
|
@ -67,5 +66,4 @@ class SourceDeleteView(SuccessMessageMixin, AdminRequiredMixin, DeleteView):
|
||||||
success_message = _('Successfully updated Source')
|
success_message = _('Successfully updated Source')
|
||||||
|
|
||||||
def get_object(self, queryset=None):
|
def get_object(self, queryset=None):
|
||||||
obj = Source.objects.get(pk=self.kwargs.get('pk'))
|
return Source.objects.filter(pk=self.kwargs.get('pk')).select_subclasses().first()
|
||||||
return obj.cast()
|
|
||||||
|
|
Reference in a new issue