Multi-platform: support multiple files per version #201

Merged
Oleg-Komarov merged 43 commits from multi-os into main 2024-07-09 16:27:46 +02:00
Showing only changes of commit a1ebb51a2a - Show all commits

View File

@ -27,18 +27,13 @@ class ExtensionQuerysetMixin:
class MaintainedExtensionMixin: class MaintainedExtensionMixin:
"""Fetch an extension by slug if current user is a maintainer. """Fetch an extension by slug if current user is a maintainer."""
If pk is present, also fetch a corresponding version.
"""
def dispatch(self, *args, **kwargs): def dispatch(self, *args, **kwargs):
self.extension = get_object_or_404( self.extension = get_object_or_404(
Extension.objects.authored_by(self.request.user), Extension.objects.authored_by(self.request.user),
slug=self.kwargs['slug'], slug=self.kwargs['slug'],
) )
if 'pk' in self.kwargs:
self.version = get_object_or_404(self.extension.versions, pk=self.kwargs['pk'])
return super().dispatch(*args, **kwargs) return super().dispatch(*args, **kwargs)