support deleting extensions #69

Merged
Oleg-Komarov merged 8 commits from delete-extension into main 2024-04-05 19:11:05 +02:00
Showing only changes of commit 71984e9a59 - Show all commits

View File

@ -172,12 +172,6 @@ class DeleteExtensionView(
def get_success_url(self):
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):
context = super().get_context_data(**kwargs)
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):
version_id = self.kwargs['pk']
version = self.extension.versions.filter(id=version_id).first()