support deleting extensions #69
@ -172,12 +172,6 @@ class DeleteExtensionView(
|
|||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
return reverse('extensions:manage-list')
|
return reverse('extensions:manage-list')
|
||||||
|
|
||||||
def get_object(self, queryset=None):
|
|
||||||
return get_object_or_404(
|
|
||||||
Extension,
|
|
||||||
slug=self.kwargs['slug'],
|
|
||||||
)
|
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super().get_context_data(**kwargs)
|
context = super().get_context_data(**kwargs)
|
||||||
context['extension_name'] = self.object.name
|
context['extension_name'] = self.object.name
|
||||||
@ -207,6 +201,13 @@ class VersionDeleteView(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get_object(self, queryset=None):
|
||||||
|
return get_object_or_404(
|
||||||
|
Version,
|
||||||
|
extension__slug=self.kwargs['slug'],
|
||||||
|
pk=self.kwargs['pk'],
|
||||||
|
)
|
||||||
|
|
||||||
def _get_version_from_id(self):
|
def _get_version_from_id(self):
|
||||||
version_id = self.kwargs['pk']
|
version_id = self.kwargs['pk']
|
||||||
version = self.extension.versions.filter(id=version_id).first()
|
version = self.extension.versions.filter(id=version_id).first()
|
||||||
|
Loading…
Reference in New Issue
Block a user